Junio C Hamano <gitster@xxxxxxxxx> writes: > The patch is made on maint-1.7.6 track for no good reason, so it may have > some merge conflicts around "resolve_ref()" vs "resolve_refdup()" if we > were to apply it on a more modern codebase, but the resolution should be > trivial. The resolution should look like this, just in case. diff --cc builtin/checkout.c index 5bf96ba,5894f40..41b9b34 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@@ -1079,5 -1102,16 +1092,16 @@@ int cmd_checkout(int argc, const char * if (opts.writeout_stage) die(_("--ours/--theirs is incompatible with switching branches.")); + if (!new.commit) { + unsigned char rev[20]; + int flag, status; - const char *old_ref = resolve_ref("HEAD", rev, 0, &flag); ++ char *old_ref = resolve_refdup("HEAD", rev, 0, &flag); + + if ((flag & REF_ISSYMREF) && is_null_sha1(rev)) { + status = switch_unborn_to_new_branch(&opts, old_ref); - free((char *)old_ref); ++ free(old_ref); + return status; + } + } return switch_branches(&opts, &new); } -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html