Skip to content

Commit

Permalink
Merge pull request #28 from shogo82148/skip-unshallow-if-already-unsh…
Browse files Browse the repository at this point in the history
…allowed

skip unshallow if the repo is already unshallowed
  • Loading branch information
haya14busa authored Nov 9, 2021
2 parents 33d8b16 + 937d974 commit 8aa0bae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,15 @@ if [ -z "${BUMP_LEVEL}" ]; then
fi
echo "Bump ${BUMP_LEVEL} version"

git fetch --tags -f # Fetch existing tags before bump.
# Fetch history as well because bump uses git history (git tag --merged).
git fetch --prune --unshallow
# check the repository is shallowed.
# comes from https://stackoverflow.com/questions/37531605/how-to-test-if-git-repository-is-shallow
if "$(git rev-parse --is-shallow-repository)"; then
# the repository is shallowed, so we need to fetch all history.
git fetch --tags -f # Fetch existing tags before bump.
# Fetch history as well because bump uses git history (git tag --merged).
git fetch --prune --unshallow
fi

CURRENT_VERSION="$(bump current)" || true
NEXT_VERSION="$(bump ${BUMP_LEVEL})" || true

Expand Down

0 comments on commit 8aa0bae

Please sign in to comment.