aboutsummaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-23 22:31:51 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-23 22:31:51 -0800
commit444e10df2a4159b5dd2975feadbb9e1213d65b47 (patch)
treee0d4c7715d74c457f063c1b12105cf77cec60dae /merge-recursive.c
parente61f25f3a6bb5dcbb5ae5f8b4ad26c308982373c (diff)
parente63ec003b2a0c89f0c1cbc4862dcef7c4a14a785 (diff)
downloadgit-444e10df2a4159b5dd2975feadbb9e1213d65b47.tar.gz
git-444e10df2a4159b5dd2975feadbb9e1213d65b47.tar.xz
Merge branch 'mm/maint-hint-failed-merge'
* mm/maint-hint-failed-merge: user-manual: Document that "git merge" doesn't like uncommited changes. merge-recursive: point the user to commit when file would be overwritten.
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index baabe2c35..a91208f29 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -3,6 +3,7 @@
* Fredrik Kuivinen.
* The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
*/
+#include "advice.h"
#include "cache.h"
#include "cache-tree.h"
#include "commit.h"
@@ -171,7 +172,7 @@ static int git_merge_trees(int index_only,
int rc;
struct tree_desc t[3];
struct unpack_trees_options opts;
- static const struct unpack_trees_error_msgs msgs = {
+ struct unpack_trees_error_msgs msgs = {
/* would_overwrite */
"Your local changes to '%s' would be overwritten by merge. Aborting.",
/* not_uptodate_file */
@@ -183,6 +184,11 @@ static int git_merge_trees(int index_only,
/* 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.";
+ }
memset(&opts, 0, sizeof(opts));
if (index_only)