format-patch: use default email for generating message ids
[gitweb.git] / builtin / checkout.c
index c93efe4d9815c8fbbb3ff0ee994e1736b26a3efd..3ddda34f7a96c56707614dbaac40631467a2b54b 100644 (file)
@@ -1092,7 +1092,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;