Merge branch 'jk/pretty-commit-header-incomplete-line'
[gitweb.git] / builtin / checkout.c
index 160f678b8cae006953ce7b4f9bdd424e53ce47f7..3ddda34f7a96c56707614dbaac40631467a2b54b 100644 (file)
@@ -543,6 +543,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
                                      opts->new_branch_force ? 1 : 0,
                                      opts->new_branch_log,
                                      opts->new_branch_force ? 1 : 0,
+                                     opts->quiet,
                                      opts->track);
                new->name = opts->new_branch;
                setup_branch_path(new);
@@ -1091,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;