4 # To the top-level directory of the current submodule
5 cd "`git rev-parse --show-toplevel`"
9 # If .git/ subdirectory is already here
12 if ! [ -f .git ]; then
13 echo "Error: Cannot find gitlink, aborting" >&2
17 # Fix core.worktree now
18 git config --unset core.worktree
20 read _gitdir gitpath < .git
23 exec mv "$gitpath" .git