Skip to content

Commit 7b80be1

Browse files
author
Junio C Hamano
committed
cache_name_compare() compares name and stage, nothing else.
The code was a bit unclear in expressing what it wants to compare. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent f9666ad commit 7b80be1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

read-cache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ int cache_name_compare(const char *name1, int flags1, const char *name2, int fla
246246
if (len1 > len2)
247247
return 1;
248248

249-
/* Differences between "assume up-to-date" should not matter. */
250-
flags1 &= ~CE_VALID;
251-
flags2 &= ~CE_VALID;
249+
/* Compare stages */
250+
flags1 &= CE_STAGEMASK;
251+
flags2 &= CE_STAGEMASK;
252252

253253
if (flags1 < flags2)
254254
return -1;

0 commit comments

Comments
 (0)