Print errno upon failure to open the COMMIT_EDITMSG file
When the COMMIT_EDITMSG cannot be opened, give more information to the user by giving the 'errno' information. Signed-off-by: Cristian Peraferrer <corellian.c@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ae081f3ebd
commit
cdeaf10f7e
@ -502,7 +502,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
|
|||||||
|
|
||||||
fp = fopen(git_path(commit_editmsg), "w");
|
fp = fopen(git_path(commit_editmsg), "w");
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
die("could not open %s", git_path(commit_editmsg));
|
die("could not open %s: %s",
|
||||||
|
git_path(commit_editmsg), strerror(errno));
|
||||||
|
|
||||||
if (cleanup_mode != CLEANUP_NONE)
|
if (cleanup_mode != CLEANUP_NONE)
|
||||||
stripspace(&sb, 0);
|
stripspace(&sb, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user