X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;ds=sidebyside;f=builtin%2Fcheckout.c;h=7250e5c23cee7deda557c16945373b59d99424ee;hb=5cba1229d8246da2a6d1d956eeed8227f69e185b;hp=4ad74270cf1ae8be73372f8511f21ed1b14efdb4;hpb=d425aa5cac0b4124c6aa5520295e0fd5ed81780b;p=git.git diff --git a/builtin/checkout.c b/builtin/checkout.c index 4ad74270c..7250e5c23 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -283,7 +283,6 @@ static void show_local_changes(struct object *head) struct rev_info rev; /* I think we want full paths, even if we're in a subdirectory. */ init_revisions(&rev, NULL); - rev.abbrev = 0; rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS; if (diff_setup_done(&rev.diffopt) < 0) die("diff_setup_done failed"); @@ -377,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); @@ -396,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); @@ -534,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];