Merge branch 'tr/maint-no-index-fixes' into maint
[gitweb.git] / builtin-checkout.c
index c2c05613b67d7cc8bd3500bdbca4fc3533afaeee..b5dd9c07b42e0130384259715730f52bc8c4e6c3 100644 (file)
@@ -681,8 +681,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
                argv++;
                argc--;
 
+               new.name = arg;
                if ((new.commit = lookup_commit_reference_gently(rev, 1))) {
-                       new.name = arg;
                        setup_branch_path(&new);
                        if (resolve_ref(new.path, rev, 1, NULL))
                                new.commit = lookup_commit_reference(rev);