Re: [PATCH 4/4] Fix ie_match_stat for non-checked-out submodule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ping Yin <pkufranky@xxxxxxxxx> writes:

> For submodules non checked out, ie_match_stat should always return 0.
> So in this case avoid calling is_racy_timestamp.

It is conceptually wrong to have this check in that function, I think.

Look at what ce_match_stat_basic() does.  For S_IFGITLINK entries, we do
not even compare the timestamps, so is_racy_timestamp() check should not
even care and should return Ok for them.

Perhaps this patch would be a better, in that it covers the other caller
on the write_index() callpath as well.

---
diff --git a/read-cache.c b/read-cache.c
index a92b25b..0a0ea3b 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -258,6 +258,7 @@ 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 &&
+		!S_ISGITLINK(ce->ce_mode) &&
 		((unsigned int)istate->timestamp) <= ce->ce_mtime);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux