From 050288d52dc5dc3f6c7716007c1069dd9f59feb7 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 3 May 2008 17:24:28 -0700 Subject: [PATCH] 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 --- read-cache.c | 3 ++- t/t7506-status-submodule.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/read-cache.c b/read-cache.c index a92b25b59..9ee125597 100644 --- a/read-cache.c +++ b/read-cache.c @@ -257,7 +257,8 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st) static int is_racy_timestamp(const struct index_state *istate, struct cache_entry *ce) { - return (istate->timestamp && + return (!S_ISGITLINK(ce->ce_mode) && + istate->timestamp && ((unsigned int)istate->timestamp) <= ce->ce_mtime); } diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh index 8987c9eb7..a75130cdb 100755 --- a/t/t7506-status-submodule.sh +++ b/t/t7506-status-submodule.sh @@ -30,7 +30,7 @@ test_expect_success 'status clean (empty submodule dir)' ' git status | grep "nothing to commit" ' -test_expect_failure 'status -a clean (empty submodule dir)' ' +test_expect_success 'status -a clean (empty submodule dir)' ' git status -a | grep "nothing to commit" ' -- 2.30.2