Re: [PATCH] t5500: fix mistaken $SERVER reference in helper function
- From
Jeff King <peff@peff.net>
- Date
- Jun 20, 2024, 15:22 UTC
- Message-ID
- <20240620152242.GA1555496@coredump.intra.peff.net>
- In-Reply-To
- <ZnM3I11IRporu4sj@google.com>
On Thu, Jun 20, 2024 at 11:27:58AM +0200, Jonathan Nieder wrote:
Show 6 quoted lines
> Alas, in a copy-and-paste gone wrong, 07ef3c6604 gets the name of the > blob (but not the commit) from "server" instead of $SERVER. And this > happens to work because the first time we call this helper, $SERVER is > "server". The only reason this happens to work at all is that we're > looking at a blob id; if we looked at the commit id, then the > timestamps wouldn't have matched.
Yep, exactly.
> Particularly telling that the author of 07ef3c6604 introduced this > typo while trying to make the tests _more_ robust.
:)
> Once the library code is ready for it, this might be a good candidate > for moving most of the test cases into unit tests and just having one > or two less repetitive integration tests.
Maybe. The subtlety fixed by 07ef3c6604 was that Git was lazy-fetching objects when we didn't want it to, and the solution was to acquire the needed data from outside the repository/process entirely. Sticking it all in a single process creates more risks there (though I agree in a robust lib-ified world you would have two separate "struct repository" handles).
-Peff