fix build checkout (remove unident reset)
This commit is contained in:
@@ -5,14 +5,18 @@ if [ "$COMMAND" == "init" ]; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ORIGIN_BRANCH_NAME=$(git symbolic-ref HEAD | sed 's!refs\/heads\/!!'| sed 's!build\/!!')
|
CURRENT_BRANCH_NAME=$(git symbolic-ref HEAD | sed 's!refs\/heads\/!!')
|
||||||
BUILD_COMMIT_MSG=$(git config --default "build from $(date --utc)" --get build.commit.messages)
|
BUILD_COMMIT_MSG=$(git config --default "build from $(date --utc)" --get build.commit.messages)
|
||||||
BUILD_BRANCH_PREFIX=$(git config --default "build" --get build.branch.prefix)
|
BUILD_BRANCH_PREFIX=$(git config --default "build" --get build.branch.prefix)
|
||||||
BUILD_REMOTE_ENABLE=$(git config --bool --default false --get build.remote.enable)
|
BUILD_REMOTE_ENABLE=$(git config --bool --default false --get build.remote.enable)
|
||||||
BUILD_REMOTE_NAME=$(git config --default "build" --get build.remote.name)
|
BUILD_REMOTE_NAME=$(git config --default "build" --get build.remote.name)
|
||||||
|
ORIGIN_BRANCH_NAME=$(git symbolic-ref HEAD | sed 's!refs\/heads\/!!'| sed "s!$BUILD_BRANCH_PREFIX\/!!")
|
||||||
BUILD_BRANCH_NAME="$BUILD_BRANCH_PREFIX/$ORIGIN_BRANCH_NAME"
|
BUILD_BRANCH_NAME="$BUILD_BRANCH_PREFIX/$ORIGIN_BRANCH_NAME"
|
||||||
|
|
||||||
git checkout -B $BUILD_BRANCH_NAME
|
if [ "$BUILD_BRANCH_NAME" != "$CURRENT_BRANCH_NAME" ]; then
|
||||||
|
git checkout $BUILD_BRANCH_NAME 2>/dev/null || git checkout -b $BUILD_BRANCH_NAME
|
||||||
|
fi
|
||||||
|
|
||||||
git add --all
|
git add --all
|
||||||
git commit -m "$(eval echo $BUILD_COMMIT_MSG)"
|
git commit -m "$(eval echo $BUILD_COMMIT_MSG)"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user