Skip to content

Commit

Permalink
always reset
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Mar 24, 2020
1 parent ef8b2f5 commit 73112d7
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions scripts/assert-changed-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

IS_CI="${CI:-false}"
GREP_PATTERN=$1
MERGE_SUCCESS=1


if [ "$IS_CI" = true ]; then
git config --local url."https://github.com/".insteadOf git@github.com:
Expand All @@ -15,7 +13,6 @@ if [ "$IS_CI" = true ]; then

if [ $? -ne 0 ]; then
echo "Branch has conflicts with master, rolling back test."
MERGE_SUCCESS=0
git merge --abort
fi

Expand All @@ -26,10 +23,8 @@ fi

FILES_COUNT="$(git diff-tree --no-commit-id --name-only -r "$CIRCLE_BRANCH" origin/master | grep -E "$GREP_PATTERN" -c)"

if [ $MERGE_SUCCESS = 1 ]; then
# reset to previous state
git reset --hard HEAD@{1}
fi
# reset to previous state
git reset --hard HEAD@{1}

if [ "$FILES_COUNT" -eq 0 ]; then
echo "0 files matching '$GREP_PATTERN'; exiting and marking successful."
Expand Down

0 comments on commit 73112d7

Please sign in to comment.