Duy Nguyen [off-list ref] 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.