is_racy_timestamp(): do not check timestamp for gitlinks
Because we do not even check the timestamp to determie if a gitlink is up to date or not, triggering the racy-timestamp check for gitlinks does not make sense. This fixes the recently added test in t7506. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
May 3, 2008 at 17:24 UTC
050288d52dc5dc3f6c7716007c1069dd9f59feb7
2 files changed
+3
-2
read-cache.c
+2
-1
@@ -257,7 +257,8 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
257
258
static int is_racy_timestamp(const struct index_state *istate, struct cache_entry *ce)
259
{
260
- return (istate->timestamp &&
260
+ return (!S_ISGITLINK(ce->ce_mode) &&
261
+ istate->timestamp &&
262
((unsigned int)istate->timestamp) <= ce->ce_mtime);
263
}
264
t/t7506-status-submodule.sh
+1
-1
@@ -30,7 +30,7 @@ test_expect_success 'status clean (empty submodule dir)' '
30
git status |
31
grep "nothing to commit"
32
'
33
-test_expect_failure 'status -a clean (empty submodule dir)' '
33
+test_expect_success 'status -a clean (empty submodule dir)' '
34
git status -a |
35
grep "nothing to commit"
36
'