Re: [PATCH 02/27] sparse-index: implement ensure_full_index()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 28, 2021, 05:25 UTC
- Message-ID
- <xmqqmtwty6nd.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CABPp-BE3tLmfwyncbdTKZUgLYH_8M9zMjH=+LJG4bdGcbYDPMg@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 12 quoted lines
>> 1. ce->ce_mode == 01000755 > > This is a weird number. What's the reason for choosing it? It looks > deceptively close to 0100755, normal executable files, but has the > extra 0, meaning that ce->ce_mode & S_IFMT is 0, suggesting it has no > file type. > > Since it's a directory, why not use S_IFDIR (040000)? > > (GITLINK does use the weird 0160000 value, but it happens to be > S_IFLNK | S_IFDIR == 0120000 | 040000, which conveys "it's both a > directory and a symlink")
Yes, that combination of IFLNK/IFDIR was the reason why we use the value. I tend to think IFDIR is the best thing to use here.