summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-04-20 15:50:13 -0700
committerJunio C Hamano <gitster@pobox.com>2012-04-20 15:50:14 -0700
commitaf78c317205ce254d9cc75fc0298ee86b579de73 (patch)
tree548fe90b56be5aa8e7cf40b9edc06e98f1fdceac
parentbd6f71d1fca865507b3f0a9e310b4d02632cf0ce (diff)
parentc5bc42b9b7bfa8dc2e769c4549572265af259d12 (diff)
downloadgit-af78c317205ce254d9cc75fc0298ee86b579de73.tar.gz
Merge branch 'bw/submodule-sed-solaris'
By Ben Walton * bw/submodule-sed-solaris: Avoid bug in Solaris xpg4/sed as used in submodule
-rwxr-xr-xgit-submodule.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index efc86ad4e0..3d94a14079 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -167,10 +167,11 @@ module_clone()
a=${a%/}
b=${b%/}
- rel=$(echo $b | sed -e 's|[^/]*|..|g')
+ # Turn each leading "*/" component into "../"
+ rel=$(echo $b | sed -e 's|[^/][^/]*|..|g')
echo "gitdir: $rel/$a" >"$path/.git"
- rel=$(echo $a | sed -e 's|[^/]*|..|g')
+ rel=$(echo $a | sed -e 's|[^/][^/]*|..|g')
(clear_local_git_env; cd "$path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
}