mirror of
https://github.com/git/git
synced 2024-10-28 19:25:47 +00:00
[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>
This commit is contained in:
parent
6ad6d3d36c
commit
1bc992acac
1 changed files with 11 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue