Subject: Re: [PATCH v4 4/4] submodule: fix case-folding gitdir filesystem colisions

From: Junio C Hamano <[email-masked]>
Date: Mon, 10 Nov 2025 15:17:31 -0800

Adrian Ratiu <[email-masked]> writes:

> I tried the mkdir approach. Unfortunately it does not work because 
> submodule_name_to_gitdir() is called on all submodule paths: both 
> existing or new, valid or non-valid.
>
> So if a dir already exists, we do not know if there is a 
> conflict. It might just be a normal valid path verification of an 
> existing module.

Puzzled.  Wouldn't that only mean that submodule-name-to-gitdir is a
wrong place to see if the name of a directory you are planning to
use for a newly added submodule is available?  IOW, don't you need a
more specific new helper function and perform the check in there?