diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-12-05 21:54:01 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-05 21:54:01 +0100 |
commit | 5bb62059f21ebe8a38226f6fbe76f0f9b6ad65f7 (patch) | |
tree | 52523c896b1eb72ed8cddb52261b7f9a909b71f0 /builtin/commit.c | |
parent | Merge branch 'ak/submodule-foreach-quoting' (diff) | |
parent | checkout: do not die when leaving broken detached HEAD (diff) | |
download | git-5bb62059f21ebe8a38226f6fbe76f0f9b6ad65f7.tar.xz git-5bb62059f21ebe8a38226f6fbe76f0f9b6ad65f7.zip |
Merge branch 'jk/robustify-parse-commit'
* jk/robustify-parse-commit:
checkout: do not die when leaving broken detached HEAD
use parse_commit_or_die instead of custom message
use parse_commit_or_die instead of segfaulting
assume parse_commit checks for NULL commit
assume parse_commit checks commit->object.parsed
log_tree_diff: die when we fail to parse a commit
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 6ab4605cf5..e89c519192 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1338,7 +1338,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1, commit = lookup_commit(sha1); if (!commit) die(_("couldn't look up newly created commit")); - if (!commit || parse_commit(commit)) + if (parse_commit(commit)) die(_("could not parse newly created commit")); strbuf_addstr(&format, "format:%h] %s"); @@ -1525,7 +1525,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) current_head = NULL; else { current_head = lookup_commit_or_die(sha1, "HEAD"); - if (!current_head || parse_commit(current_head)) + if (parse_commit(current_head)) die(_("could not parse HEAD commit")); } argc = parse_and_validate_options(argc, argv, builtin_commit_options, |