Re: [PATCH 0/4] attribute regression fix for maint-1.8.1 and upward
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 27, 2013, 03:57 UTC
- Message-ID
- <7vmwtpqyui.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130327011309.GA10946@duynguyen-vnpc.dek-tpc.internal>
Duy Nguyen <pclouds@gmail.com> writes:
> How about this? git_check_attr() now takes dtype as an argument > and the caller must not add the trailing slash. This could be > split into two patches, one for git_check_attr prototype change, > and the other the real meat.
"git check-attr" fundamentally cannot know, but aside from that do all the callsites know if the path in question is a directory or not? My impression was that there are some cases you do not necessarily know.
"Add slash when you _know_ it is a directory, but otherwise pass the path without trailing slash." is easier to understand than "Pass 040000 if you know it is a directory, but otherwise pass 100644", exactly because "otherwise" in both of these instructions include the case where the path in question _is_ a directory (you just do not know what it is).
I do not particularly like the "trailing slash on the basename" approach, but it feels less bad than passing dtype down.