Merge branch 'ef/checkout-empty' into maint
Running "git checkout" on an unborn branch used to corrupt HEAD (regression in 1.7.10); this makes it error out. By Erik Faye-Lund * ef/checkout-empty: checkout: do not corrupt HEAD on empty repo
This commit is contained in:
@ -1091,7 +1091,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
|
||||
if (opts.writeout_stage)
|
||||
die(_("--ours/--theirs is incompatible with switching branches."));
|
||||
|
||||
if (!new.commit) {
|
||||
if (!new.commit && opts.new_branch) {
|
||||
unsigned char rev[20];
|
||||
int flag;
|
||||
|
||||
|
Reference in New Issue
Block a user