summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 69c3051)
raw | patch | inline | side by side (parent: 69c3051)
author | Johannes Sixt <j6t@kdbg.org> | |
Sun, 4 Mar 2012 21:16:19 +0000 (22:16 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Mar 2012 05:22:46 +0000 (21:22 -0800) |
Under Windows the "git rev-parse --git-dir" and "pwd" commands may return
either drive-letter-colon or POSIX style paths. This makes module_clone()
behave badly because it expects absolute paths to always start with a '/'.
Fix that by always converting the "c:/" notation into "/c/" when computing
the relative paths from gitdir to the submodule work tree and back.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
either drive-letter-colon or POSIX style paths. This makes module_clone()
behave badly because it expects absolute paths to always start with a '/'.
Fix that by always converting the "c:/" notation into "/c/" when computing
the relative paths from gitdir to the submodule work tree and back.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh | patch | blob | history |
diff --git a/git-submodule.sh b/git-submodule.sh
index a9e98224ae1a44013ff56dd6030c1ceb400a8818..efc86ad4e0b90edbbf5a927aa87e7ad4b1a1949e 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
a=$(cd "$gitdir" && pwd)/
b=$(cd "$path" && pwd)/
+ # normalize Windows-style absolute paths to POSIX-style absolute paths
+ case $a in [a-zA-Z]:/*) a=/${a%%:*}${a#*:} ;; esac
+ case $b in [a-zA-Z]:/*) b=/${b%%:*}${b#*:} ;; esac
# Remove all common leading directories after a sanity check
if test "${a#$b}" != "$a" || test "${b#$a}" != "$b"; then
die "$(eval_gettext "Gitdir '\$a' is part of the submodule path '\$b' or vice versa")"