From: Junio C Hamano Date: Mon, 30 Nov 2009 22:45:08 +0000 (-0800) Subject: Merge branch 'mm/maint-merge-ff-error-message-fix' X-Git-Tag: v1.6.6-rc1~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=045c05048530b8c57c410886e5f64d91a44c2c83;p=git.git Merge branch 'mm/maint-merge-ff-error-message-fix' Conflicts: merge-recursive.c --- 045c05048530b8c57c410886e5f64d91a44c2c83 diff --cc merge-recursive.c index a91208f29,72bfbaf43..dd4fbd0e6 --- a/merge-recursive.c +++ b/merge-recursive.c @@@ -1188,6 -1168,23 +1171,28 @@@ static int process_entry(struct merge_o return clean_merge; } + struct unpack_trees_error_msgs get_porcelain_error_msgs(void) + { + struct unpack_trees_error_msgs msgs = { + /* would_overwrite */ + "Your local changes to '%s' would be overwritten by merge. Aborting.", + /* not_uptodate_file */ + "Your local changes to '%s' would be overwritten by merge. Aborting.", + /* not_uptodate_dir */ + "Updating '%s' would lose untracked files in it. Aborting.", + /* would_lose_untracked */ + "Untracked working tree file '%s' would be %s by merge. Aborting", + /* bind_overlap -- will not happen here */ + NULL, + }; ++ if (advice_commit_before_merge) { ++ msgs.would_overwrite = msgs.not_uptodate_file = ++ "Your local changes to '%s' would be overwritten by merge. Aborting.\n" ++ "Please, commit your changes or stash them before you can merge."; ++ } + return msgs; + } + int merge_trees(struct merge_options *o, struct tree *head, struct tree *merge,