From 1bc992acacf5961e65d9fdddeb8561284e708c74 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 18 Apr 2005 10:42:48 -0700 Subject: [PATCH] [PATCH] Fix confusing behaviour of update-cache --refresh on unmerged paths. The "update-cache --refresh" command attempts refresh_entry() on unmerged path, which results in as many "needs update" messages as there are unmerged stages for that path. This does not do any harm to the working directory, but it is confusing. Here is a fix. Signed-off-by: Junio C Hamano Signed-off-by: Linus Torvalds --- update-cache.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/update-cache.c b/update-cache.c index 7c3a14355..68d2f95c1 100644 --- a/update-cache.c +++ b/update-cache.c @@ -196,9 +196,18 @@ static void refresh_cache(void) int i; for (i = 0; i < active_nr; i++) { - struct cache_entry *ce = active_cache[i]; - struct cache_entry *new = refresh_entry(ce); + struct cache_entry *ce, *new; + ce = active_cache[i]; + if (ce_stage(ce)) { + printf("%s: needs merge\n", ce->name); + while ((i < active_nr) && + ! strcmp(active_cache[i]->name, ce->name)) + i++; + i--; + continue; + } + new = refresh_entry(ce); if (!new) { printf("%s: needs update\n", ce->name); continue; -- 2.30.2