Re: [PATCH v5] Add an explicit GIT_DIR to the list of excludes
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 11, 2014, 10:48 UTC
- Message-ID
- <CACsJy8Cgu792Tamej3+_9w=Krg8nezYYA6k604gikebHG=yVUg@mail.gmail.com>
- In-Reply-To
- <CAKpPgveXen9sQefo8dva1Uy4YOyroT6cPXLzgUvxj93Zqw13zw@mail.gmail.com>
On Tue, Jun 10, 2014 at 10:18 AM, Pasha Bolokhov <pasha.bolokhov@gmail.com> wrote:
Show 10 quoted lines
>> On Thu, Jun 5, 2014 at 3:15 AM, Pasha Bolokhov <pasha.bolokhov@gmail.com> wrote:
>>> + /* only add it if GIT_DIR does not end with '.git' or '/.git' */
>>> + if (len < 4 || strcmp(n_git + len - 4, ".git") ||
>>> + (len > 4 && n_git[len - 5] != '/')) {
>>
>> Hmm.. should we exclude "foobar.git" as well?
>
> Why wouldn't we? Everything that has basename ".git" is hard-wired
> to be excluded, but everything else, including "foobar.git" should be
> added to the excludes manually... How is it better than just "foobar"?Yes everything except ".git" should be excluded. And you do exactly that. I misread the code (probably better to write "if (!(<basename is ".git>))", maybe)
-- Duy