]> git.phdru.name Git - git-scripts.git/blob - submodules/unabsorbgitdirs
Add scripts to unabsorb git dirs
[git-scripts.git] / submodules / unabsorbgitdirs
1 #! /bin/sh
2 set -e
3
4 # To the top-level directory of the current submodule
5 cd "`git rev-parse --show-toplevel`"
6
7 unset GIT_DIR
8
9 # If .git/ subdirectory is already here
10 test -d .git && exit 0
11
12 if ! test -f .git; then
13     echo "Error: Cannot find gitlink, aborting" >&2
14     exit 1
15 fi
16
17 # Fix core.worktree now
18 git config --unset core.worktree
19
20 read _gitdir gitpath < .git
21 unset _gitdir
22 rm .git
23 exec mv "$gitpath" .git