summaryrefslogtreecommitdiff
path: root/bin/git-unshallow
blob: 5cfb223c830479b7e8c3907cef56759ecd7625f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

# assumes remote named origin

if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
    git fetch --unshallow origin
    # does not seem to be needed anymore?
    # git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
    # git fetch origin
else
    echo >&2 "fatal: repository is not shallow"
    exit 1
fi