Browse Source

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>
maint
Cristian Peraferrer 17 years ago committed by Junio C Hamano
parent
commit
cdeaf10f7e
  1. 3
      builtin-commit.c

3
builtin-commit.c

@ -502,7 +502,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix) @@ -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);

Loading…
Cancel
Save