X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Frevert.c;h=1f27c63343904a969e60ab19408495007f59d133;hb=08303c3636ef750bfafd1c47f363120cb439b367;hp=f697e6695374d06e7b08c9faac1ebaefe4ff31d7;hpb=06c0f42f94272980e367db82092fa1b702afc625;p=git.git diff --git a/builtin/revert.c b/builtin/revert.c index f697e6695..1f27c6334 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -408,8 +408,6 @@ static int do_pick_commit(void) discard_cache(); if (!commit->parents) { - if (action == REVERT) - die (_("Cannot revert a root commit")); parent = NULL; } else if (commit->parents->next) { @@ -467,7 +465,7 @@ static int do_pick_commit(void) strbuf_addstr(&msgbuf, "\"\n\nThis reverts commit "); strbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1)); - if (commit->parents->next) { + if (commit->parents && commit->parents->next) { strbuf_addstr(&msgbuf, ", reversing\nchanges made to "); strbuf_addstr(&msgbuf, sha1_to_hex(parent->object.sha1)); }