On Tue, Jul 09, 2024 at 05:05:58AM -0400, Karthik Nayak wrote: > >> +test_expect_success 'detect empty remote' ' > >> + test_must_fail git push "" main 2> stderr && > >> + grep "fatal: bad repository ''" stderr > >> +' > > > > The test makes sense. Your single-quotes are not doing what you expect, > > though (they are closing and re-opening the outer test body, so end up > > as the empty string). You can use $SQ$SQ instead (I'm also working on > > patches to allow you to specify the body as a here-doc to avoid exactly > > this kind of situation, but I don't think we should depend on that yet). > > Good catch. I'm wondering how it worked though, since I wrote the test > before the fix and used the test to validate the failure and the fix. You end up grepping for the sub-string "fatal: bad repository ", which still matches. It's just not quite as careful as what you intended. -Peff