Merge branch 'mm/maint-merge-ff-error-message-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 30 Nov 2009 22:45:08 +0000 (14:45 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Nov 2009 22:45:08 +0000 (14:45 -0800)
Conflicts:
merge-recursive.c

1  2 
builtin-merge.c
merge-recursive.c

diff --cc builtin-merge.c
Simple merge
@@@ -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,