Code

Print errno upon failure to open the COMMIT_EDITMSG file
authorCristian Peraferrer <corellian.c@gmail.com>
Fri, 20 Jun 2008 15:24:20 +0000 (17:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 21 Jun 2008 07:01:37 +0000 (00:01 -0700)
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>
builtin-commit.c

index 90200ed643bcf21f28a66396f0d15db920a5d4c8..a33f43a209efc2abef209b10b55fa2fce1c7ce18 100644 (file)
@@ -502,7 +502,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 
        fp = fopen(git_path(commit_editmsg), "w");
        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)
                stripspace(&sb, 0);