Skip to content

Commit

Permalink
is_racy_timestamp(): do not check timestamp for gitlinks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed May 5, 2008
1 parent 451244d commit 050288d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion read-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion t/t7506-status-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
'
Expand Down

0 comments on commit 050288d

Please sign in to comment.