Junio C Hamano <gitster@xxxxxxxxx> writes: > Mentioned elsewhere, but I think the above should be > > if (!path) > path = obj_context.path; > > if (obj_context.mode == S_IFINVALID) > obj_context.mode = 0100644; > > IOW, even when there is an explicit path supplied, we should fall > back to assumed "regular blob" mode, so that > > git cat-file --filters --path=README $(git rev-parse :README) > > would work as expected. Actually, I am reading the conditional the other way, but the conclusion "defaulting from unknown mode to regular blob is necessary whether the user gave us a path or not" is the same. The current code may fail if --path is not available and 40-hex that does not give us any context of look up is given because it won't be able to decide how to filter, so using "else if" would not have practical difference there, but conceptually it still is wrong. -- 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