On Tue, May 03, 2016 at 11:53:36AM -0700, Stefan Beller wrote: > > is related or worth doing on top. But I don't think so. That code is > > just trying to convert some error-cases into "let's err on the side of > > assuming it is a repo". Doing that for all values of gitfile_error is > > definitely the wrong thing (it would treat a totally non-existent > > ".git" file as "yes, it's there", which is clearly bogus). > > The proposed change is overly eager indeed. > What if we get back a READ_GITFILE_ERR_STAT_FAILED ? > I would think that is a reasonable indicator of a submodule being there? > (The stat failure may be transient ENOMEM Out of memory (i.e., kernel memory).) That would certainly be wrong with read_gitfile_gently() as it is today; it does not distinguish various values of errno for stat(), so that would get the "there's not even a .git file here at all" case wrong. So the first step would be to have read_gitfile_gently() start looking for ENOENT versus other errors. I don't know if that's worth the trouble; we're pretty cavalier about treating stat failure as "file does not exist" in the rest of the code. -Peff -- 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