summaryrefslogtreecommitdiff
path: root/builtin/revert.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-11-24 12:44:46 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-11-24 12:44:46 -0800
commit2f9d2e22cb553d26e355e63171678a848170dcf8 (patch)
tree9b2b237fb9cc9beee2c602ce3c7822b0b456fcb8 /builtin/revert.c
parentMerge branch 'uk/fix-author-ident-sed-script' into maint (diff)
parentbuiltin/revert.c: don't dereference a NULL pointer (diff)
downloadtgif-2f9d2e22cb553d26e355e63171678a848170dcf8.tar.xz
Merge branch 'bc/fix-cherry-pick-root' into maint
* bc/fix-cherry-pick-root: builtin/revert.c: don't dereference a NULL pointer
Diffstat (limited to 'builtin/revert.c')
-rw-r--r--builtin/revert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index 4b47ace36b..57b51e4a0e 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -442,7 +442,7 @@ static int do_pick_commit(void)
else
parent = commit->parents->item;
- if (allow_ff && !hashcmp(parent->object.sha1, head))
+ if (allow_ff && parent && !hashcmp(parent->object.sha1, head))
return fast_forward_to(commit->object.sha1, head);
if (parent && parse_commit(parent) < 0)