]> git.ipfire.org Git - thirdparty/git.git/commit
submodule--helper: fix filesystem collisions by encoding gitdir paths
authorAdrian Ratiu <adrian.ratiu@collabora.com>
Wed, 7 Jan 2026 23:01:42 +0000 (01:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Jan 2026 02:05:15 +0000 (11:05 +0900)
commitee437749ff136ae7e02555da7f58cdcc0c0b56c9
tree9fdac0e2a8b60b606c120244ee5319d2fb40d37e
parent7621825c43370079617d2d613298c38d9d05505b
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