Skip to content

Commit 270305e

Browse files
committed
Fixed regex, die on failure to detect subsplit
The regex for branches was not correct. It was not filtering the `^{}` versions. Will now die early if it is likely that git subtree is not currently installed.
1 parent c8422ea commit 270305e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

git-subsplit.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"
3030
# We can run this from anywhere.
3131
NONGIT_OK=1
3232

33-
PATH=$PATH:$(git --exec-path)
33+
GIT_EXEC_PATH=$(git --exec-path)
34+
35+
PATH=$PATH:$GIT_EXEC_PATH
3436

3537
. git-sh-setup
3638

39+
if [ ! -e "${GIT_EXEC_PATH}/git-subtree" ]
40+
then
41+
die "Git subplit relies on git subtree; please install git subtree or upgrade git"
42+
fi
43+
3744
ANNOTATE=
3845
QUIET=
3946
COMMAND=
@@ -132,7 +139,7 @@ subsplit_publish()
132139
if [ -z "$TAGS" ] && [ -z "$NO_TAGS" ]
133140
then
134141
# If tags are not specified and we want tags, discover them.
135-
TAGS="$(git ls-remote origin 2>/dev/null | grep -v "^{}" | grep "refs/tags/" | cut -f3 -d/)"
142+
TAGS="$(git ls-remote origin 2>/dev/null | grep -v "\^{}" | grep "refs/tags/" | cut -f3 -d/)"
136143
fi
137144

138145
for SPLIT in $SPLITS

0 commit comments

Comments
 (0)