Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-17 23:28:24 +0300
committerJunio C Hamano <gitster@pobox.com>2019-07-19 00:47:28 +0300
commitb2b1f615ce3b9383a32dec7f84488284004224f3 (patch)
tree7cb1583b701ff1b1df55688d80f010673ebe6785 /builtin/rm.c
parent0d0ac3826a3bbb9247e39e12623bbcfdd722f24c (diff)
rm: resolving by removal is not a warning-worthy event
When resolving a conflict on a path in favor of removing it, using "git rm" on it is the standard way to do so. The user however is greeted with a "needs merge" message during that operation: $ git merge side-branch $ edit conflicted-path-1 $ git add conflicted-path-1 $ git rm conflicted-path-2 conflicted-path-2: needs merge rm 'conflicted-path-2' The removal by "git rm" does get performed, but an uninitiated user may find it confusing, "needs merge? so I need to resolve conflict before being able to remove it???" The message is coming from "update-index --refresh" that is called internally to make sure "git rm" knows which paths are clean and which paths are dirty, in order to prevent removal of paths modified relative to the index without the "-f" option. We somehow ended up not squelching this message which seeped through to the UI surface. Use the same mechanism used by "git commit", "git describe", etc. to squelch the message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rm.c')
-rw-r--r--builtin/rm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/rm.c b/builtin/rm.c
index 17086d3d97c..3ddce9cf061 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -272,7 +272,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
parse_pathspec(&pathspec, 0,
PATHSPEC_PREFER_CWD,
prefix, argv);
- refresh_index(&the_index, REFRESH_QUIET, &pathspec, NULL, NULL);
+ refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &pathspec, NULL, NULL);
seen = xcalloc(pathspec.nr, 1);