]> git.ipfire.org Git - thirdparty/git.git/commit
submodule--helper: fix filesystem collisions by encoding gitdir paths
authorAdrian Ratiu <adrian.ratiu@collabora.com>
Mon, 12 Jan 2026 18:46:29 +0000 (20:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jan 2026 19:56:56 +0000 (11:56 -0800)
commit920fbe4d4ee8d4e191d33dde05a16ee0e74bdd44
tree7c34bcb0415a2e96f886b20e106bd244c6753b98
parent226694bdf4aaecd18f6cd4df12656cc61b213d16
submodule--helper: fix filesystem collisions by encoding gitdir paths

Fix nested filesystem collisions by url-encoding gitdir paths stored
in submodule.%s.gitdir, when extensions.submodulePathConfig is enabled.

Credit goes to Junio and Patrick for coming up with this design: the
encoding is only applied when necessary, to newly added submodules.

Existing modules don't need the encoding because git already errors
out when detecting nested gitdirs before this patch.

This commit adds the basic url-encoding and some tests. Next commits
extend the encode -> validate -> retry loop to fix more conflicts.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Suggested-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
submodule.c
t/t7425-submodule-gitdir-path-extension.sh