From: Cristian Peraferrer Date: Fri, 20 Jun 2008 15:24:20 +0000 (+0200) Subject: Print errno upon failure to open the COMMIT_EDITMSG file X-Git-Tag: v1.6.0-rc0~241 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cdeaf10f7e2754054c7be5d74227c698d2a71890;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin-commit.c b/builtin-commit.c index 90200ed64..a33f43a20 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -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);