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>
Cristian Peraferrer committed
Jun 20, 2008 at 17:24 UTC
cdeaf10f7e2754054c7be5d74227c698d2a71890
1 file changed
+2
-1
builtin-commit.c
+2
-1
@@ -502,7 +502,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
502
503
fp = fopen(git_path(commit_editmsg), "w");
504
if (fp == NULL)
505
- die("could not open %s", git_path(commit_editmsg));
505
+ die("could not open %s: %s",
506
+ git_path(commit_editmsg), strerror(errno));
507
508
if (cleanup_mode != CLEANUP_NONE)
509
stripspace(&sb, 0);