Re: [PATCH] prune: recursively prune objects directory
From: Junio C Hamano <hidden>
Date: 2022-11-22 23:16:23
Eric Wong [off-list ref] writes:
Junio C Hamano [off-list ref] wrote:quoted
Eric Wong [off-list ref] writes:quoted
I am unsure about duplicating ishex() from name-rev.c, however...Yeah, I wonder why name-rev.c does not use isxdigit() in the first place.isxdigit includes uppercase [A-F]. I think being strict is better, here. I don't want to open up a can of worms if we become tolerant of 3rd-party git implementations developed on case-insensitive FSes.
OK, we do not recurse into .git/objects/AA/ for the same reason why
we do not recurse into .git/objects/info/. We do expect [0-9a-f]{2}
and pack to be directories, so we go silent if they are missing, but
we do complain if somebody creates a regular file .git/objects/aa
for fun.
I agree that isxdigit() is not a good match. I also agree with what
you said about it belong to git-compat-util.h but let's leave it for
a future clean-up patch to remove both copies of ishex(), introduce
islxdigit() in git-compat-util.h and use it as its replacement.