aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorDiane Gasselin <diane.gasselin@ensimag.imag.fr>2010-08-11 10:38:05 +0200
committerJunio C Hamano <gitster@pobox.com>2010-08-11 10:36:03 -0700
commit23cbf11b5c08c6d0ab0fd0d6f2dc5a32ca31c745 (patch)
tree61c94915e74e7118388bcc5bb1422eadf2a83bfe /builtin
parent08353ebbab2dfdee50a6daa616ec8b6483cb07c8 (diff)
downloadgit-23cbf11b5c08c6d0ab0fd0d6f2dc5a32ca31c745.tar.gz
git-23cbf11b5c08c6d0ab0fd0d6f2dc5a32ca31c745.tar.xz
merge-recursive: porcelain messages for checkout
A porcelain message was first added in checkout.c in the commit 8ccba008 (Junio C Hamano, Sat May 17 21:03:49 2008, unpack-trees: allow Porcelain to give different error messages) to give better feedback in the case of merge errors. This patch adapts the porcelain messages for the case of checkout instead. This way, when having a checkout error, "merge" no longer appears in the error message. While we're there, we add an advice in the case of would_lose_untracked_file. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c2
-rw-r--r--builtin/merge.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 7d1706e0f..22bf47cb6 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -373,7 +373,7 @@ static int merge_working_tree(struct checkout_opts *opts,
topts.src_index = &the_index;
topts.dst_index = &the_index;
- topts.msgs[ERROR_NOT_UPTODATE_FILE] = "You have local changes to '%s'; cannot switch branches.";
+ set_porcelain_error_msgs(topts.msgs, "checkout");
refresh_cache(REFRESH_QUIET);
diff --git a/builtin/merge.c b/builtin/merge.c
index 115a28854..de5a0f629 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -704,7 +704,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote
opts.verbose_update = 1;
opts.merge = 1;
opts.fn = twoway_merge;
- set_porcelain_error_msgs(opts.msgs);
+ set_porcelain_error_msgs(opts.msgs, "merge");
trees[nr_trees] = parse_tree_indirect(head);
if (!trees[nr_trees++])