]> Pileus Git - ~andy/git/blobdiff - builtin-commit.c
Use a clearer style to issue commands to remote helpers
[~andy/git] / builtin-commit.c
index 88c51bdd3ae996673fa8abaa97a3da98396f5f3e..4bcce06fbffdf10ec701dfbc0b6b90a11513f89e 100644 (file)
@@ -434,7 +434,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
                if (isatty(0))
                        fprintf(stderr, "(reading log message from standard input)\n");
                if (strbuf_read(&sb, 0, 0) < 0)
-                       die("could not read log from standard input");
+                       die_errno("could not read log from standard input");
                hook_arg1 = "message";
        } else if (logfile) {
                if (strbuf_read_file(&sb, logfile, 0) < 0)
@@ -964,8 +964,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
        /* Finally, get the commit message */
        strbuf_reset(&sb);
        if (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0) {
+               int saved_errno = errno;
                rollback_index_files();
-               die("could not read commit message");
+               die("could not read commit message: %s", strerror(saved_errno));
        }
 
        /* Truncate the message just before the diff, if any. */