Re: [PATCH 2/2] resolve_gitlink_ref: ignore non-repository paths
- From
Jeff King <peff@peff.net>
- Date
- Jan 22, 2016, 22:31 UTC
- Message-ID
- <20160122223154.GA15635@sigill.intra.peff.net>
- In-Reply-To
- <20160122222930.GB15560@sigill.intra.peff.net>
On Fri, Jan 22, 2016 at 05:29:30PM -0500, Jeff King wrote:
Show 14 quoted lines
> diff --git a/t/t3000-ls-files-others.sh b/t/t3000-ls-files-others.sh > index 88be904..c525656 100755 > --- a/t/t3000-ls-files-others.sh > +++ b/t/t3000-ls-files-others.sh > @@ -65,6 +65,13 @@ test_expect_success '--no-empty-directory hides empty directory' ' > test_cmp expected3 output > ' > > +test_expect_success 'ls-files --others handles non-submodule .git' ' > + mkdir not-a-submodule && > + echo foo >not-a-submodule/.git && > + git ls-files -o >output && > + test_cmp expected1 output > +'
BTW, I scratched my head about why I was able to use "expected1" here without having to add "not-a-submodule" to it. But the answer is that the directory itself does not get mentioned (it is not a file!), and we seem to always exclude ".git" paths entirely.
I'm not sure if that's the best thing in every case (what if you have precious content in a ".git" file?), but this does behave exactly as a valid ".git" would with an empty HEAD ref. So I think it's a reasonable behavior in practice.
-Peff