Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions git-subsplit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,13 @@ subsplit_publish()
fi

say " - syncing branch '${HEAD}'"

git checkout master >/dev/null 2>&1
git branch -D "$LOCAL_BRANCH" >/dev/null 2>&1
git branch -D "${LOCAL_BRANCH}-checkout" >/dev/null 2>&1
git checkout -b "${LOCAL_BRANCH}-checkout" "origin/${HEAD}" >/dev/null 2>&1
git subtree split -q --prefix="$SUBPATH" --branch="$LOCAL_BRANCH" "origin/${HEAD}" >/dev/null
RETURNCODE=$?

if [ -n "$VERBOSE" ];
then
Expand All @@ -231,7 +233,7 @@ subsplit_publish()
echo "${DEBUG} git subtree split -q --prefix=\"$SUBPATH\" --branch=\"$LOCAL_BRANCH\" \"origin/${HEAD}\" >/dev/null"
fi

if [ $? -eq 0 ]
if [ $RETURNCODE -eq 0 ]
then
PUSH_CMD="git push -q ${DRY_RUN} --force $REMOTE_NAME ${LOCAL_BRANCH}:${HEAD}"

Expand Down Expand Up @@ -291,14 +293,15 @@ subsplit_publish()

say " - subtree split for '${TAG}'"
git subtree split -q --annotate="${ANNOTATE}" --prefix="$SUBPATH" --branch="$LOCAL_TAG" "$TAG" >/dev/null
RETURNCODE=$?

if [ -n "$VERBOSE" ];
then
echo "${DEBUG} git subtree split -q --annotate=\"${ANNOTATE}\" --prefix=\"$SUBPATH\" --branch=\"$LOCAL_TAG\" \"$TAG\" >/dev/null"
fi

say " - subtree split for '${TAG}' [DONE]"
if [ $? -eq 0 ]
if [ $RETURNCODE -eq 0 ]
then
PUSH_CMD="git push -q ${DRY_RUN} --force ${REMOTE_NAME} ${LOCAL_TAG}:refs/tags/${TAG}"

Expand Down