Merge branch 'mg/cherry-pick-multi-on-unborn'
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Jun 2016 16:56:53 +0000 (09:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Jun 2016 16:56:53 +0000 (09:56 -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();