]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/revert.c
Merge branch 'jn/cherry-pick-refresh-index'
[thirdparty/git.git] / builtin / revert.c
index d849f40fcc177616fa9f9c6f2f10f3625d568902..bb6e9e83b756b47dae449064ca7762fe3558fc0e 100644 (file)
@@ -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)