Skip to content

Commit af78c31

Browse files
committed
Merge branch 'bw/submodule-sed-solaris'
By Ben Walton * bw/submodule-sed-solaris: Avoid bug in Solaris xpg4/sed as used in submodule
2 parents bd6f71d + c5bc42b commit af78c31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git-submodule.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ module_clone()
167167
a=${a%/}
168168
b=${b%/}
169169

170-
rel=$(echo $b | sed -e 's|[^/]*|..|g')
170+
# Turn each leading "*/" component into "../"
171+
rel=$(echo $b | sed -e 's|[^/][^/]*|..|g')
171172
echo "gitdir: $rel/$a" >"$path/.git"
172173

173-
rel=$(echo $a | sed -e 's|[^/]*|..|g')
174+
rel=$(echo $a | sed -e 's|[^/][^/]*|..|g')
174175
(clear_local_git_env; cd "$path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
175176
}
176177

0 commit comments

Comments
 (0)