X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Fcheckout.c;h=7250e5c23cee7deda557c16945373b59d99424ee;hb=aca35505db3706c87d391dd213e856f73edfd42c;hp=1f7e1546f69acaef5e3c5cca1476acec972cb334;hpb=226d06c16bcafda3417163437be9845130fd4998;p=git.git diff --git a/builtin/checkout.c b/builtin/checkout.c index 1f7e1546f..7250e5c23 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -376,7 +376,7 @@ static int merge_working_tree(struct checkout_opts *opts, topts.src_index = &the_index; topts.dst_index = &the_index; - topts.msgs.not_uptodate_file = "You have local changes to '%s'; cannot switch branches."; + set_porcelain_error_msgs(topts.msgs, "checkout"); refresh_cache(REFRESH_QUIET); @@ -395,6 +395,7 @@ static int merge_working_tree(struct checkout_opts *opts, topts.dir = xcalloc(1, sizeof(*topts.dir)); topts.dir->flags |= DIR_SHOW_IGNORED; topts.dir->exclude_per_dir = ".gitignore"; + topts.show_all_errors = 1; tree = parse_tree_indirect(old->commit ? old->commit->object.sha1 : (unsigned char *)EMPTY_TREE_SHA1_BIN); @@ -533,10 +534,13 @@ static void update_refs_for_switch(struct checkout_opts *opts, if (old->path && !strcmp(new->path, old->path)) fprintf(stderr, "Already on '%s'\n", new->name); - else + else if (opts->new_branch) fprintf(stderr, "Switched to%s branch '%s'\n", opts->branch_exists ? " and reset" : " a new", new->name); + else + fprintf(stderr, "Switched to branch '%s'\n", + new->name); } if (old->path && old->name) { char log_file[PATH_MAX], ref_file[PATH_MAX];