From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Andreas Krey <a.krey@gmx.de>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] resolve_gitlink_ref: ignore non-repository paths
Date: Fri, 22 Jan 2016 17:31:54 -0500 [thread overview]
Message-ID: <20160122223154.GA15635@sigill.intra.peff.net> (raw)
In-Reply-To: <20160122222930.GB15560@sigill.intra.peff.net>
On Fri, Jan 22, 2016 at 05:29:30PM -0500, Jeff King wrote:
> 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
next prev parent reply other threads:[~2016-01-22 22:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-22 9:17 Minor bug, git ls-files -o aborts because of broken submodules Duy Nguyen
2016-01-22 21:18 ` Jeff King
2016-01-22 22:26 ` Jeff King
2016-01-22 22:27 ` [PATCH 1/2] clean: make is_git_repository a public function Jeff King
2016-01-22 22:29 ` [PATCH 2/2] resolve_gitlink_ref: ignore non-repository paths Jeff King
2016-01-22 22:31 ` Jeff King [this message]
2016-01-22 22:36 ` Stefan Beller
2016-01-22 22:40 ` Jeff King
2016-01-25 13:13 ` Minor bug, git ls-files -o aborts because of broken submodules Andreas Krey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160122223154.GA15635@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=a.krey@gmx.de \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).