aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-04-18 10:42:48 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-18 10:42:48 -0700
commit1bc992acacf5961e65d9fdddeb8561284e708c74 (patch)
tree4dca8f7c63099bfb713f915c110f1fd2ae634337
parent6ad6d3d36c5924c8ff502ebbb6a6216df01e7efb (diff)
downloadgit-1bc992acacf5961e65d9fdddeb8561284e708c74.tar.gz
git-1bc992acacf5961e65d9fdddeb8561284e708c74.tar.xz
[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 <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--update-cache.c13
1 files 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;