setup: refactor repo format reading and verification
[gitweb.git] / builtin / checkout.c
index 5af84a3118d20da437d3e08c1667f76dc2f57845..efcbd8f6b5e0b7d551c88c02b6d7d3069a47944d 100644 (file)
@@ -662,7 +662,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
                }
        } else if (new->path) { /* Switch branches. */
                if (create_symref("HEAD", new->path, msg.buf) < 0)
-                       die("unable to update HEAD");
+                       die(_("unable to update HEAD"));
                if (!opts->quiet) {
                        if (old->path && !strcmp(new->path, old->path)) {
                                if (opts->new_branch_force)
@@ -982,7 +982,8 @@ static int parse_branchname_arg(int argc, const char **argv,
                 */
                int recover_with_dwim = dwim_new_local_branch_ok;
 
-               if (check_filename(NULL, arg) && !has_dash_dash)
+               if (!has_dash_dash &&
+                   (check_filename(NULL, arg) || !no_wildcard(arg)))
                        recover_with_dwim = 0;
                /*
                 * Accept "git checkout foo" and "git checkout foo --"