We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5372f7c commit 39d372fCopy full SHA for 39d372f
scripts/squash-branch
@@ -2,7 +2,7 @@
2
3
# Defaults
4
TARGET_BRANCH="gh-pages"
5
-NUM_COMMITS="5"
+declare -i NUM_COMMITS=5
6
REMOTE="origin"
7
8
function die()
@@ -39,9 +39,10 @@ set -x
39
40
# Preconditions
41
test -f .git/config || die "Not a git workdir"
42
+test "${NUM_COMMITS}" -gt "0" || die "Not enough commits"
43
44
OLD_TARGET_BRANCH="old-${TARGET_BRANCH}"
-INITIAL_REV="${OLD_TARGET_BRANCH}~${NUM_COMMITS}"
45
+INITIAL_REV="${OLD_TARGET_BRANCH}~$((NUM_COMMITS-1))"
46
47
# Starting point
48
git fetch ${REMOTE}
0 commit comments