OSDN Git Service

Merge branch 'mg/cherry-pick-multi-on-unborn' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 6 Jul 2016 20:06:42 +0000 (13:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jul 2016 20:06:42 +0000 (13:06 -0700)
"git cherry-pick A" worked on an unborn branch, but "git
cherry-pick A..B" didn't.

* mg/cherry-pick-multi-on-unborn:
  cherry-pick: allow to pick to unborn branches

1  2 
sequencer.c

diff --cc sequencer.c
@@@ -885,9 -916,13 +885,13 @@@ static int sequencer_rollback(struct re
        fclose(f);
        if (get_sha1_hex(buf.buf, sha1) || buf.buf[40] != '\0') {
                error(_("stored pre-cherry-pick HEAD file '%s' is corrupt"),
 -                      filename);
 +                      git_path_head_file());
                goto fail;
        }
+       if (is_null_sha1(sha1)) {
+               error(_("cannot abort from a branch yet to be born"));
+               goto fail;
+       }
        if (reset_for_rollback(sha1))
                goto fail;
        remove_sequencer_state();