Skip to content

Commit

Permalink
fix: don't throw away untracked files when run locally
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed May 22, 2024
1 parent 60c9f2b commit f5809a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ exit_status=0
if ! is_strict_check_on_push_demanded; then
execute_shellcheck "${only_changed_scripts[@]}" > "${WORK_DIR}head-shellcheck.err"

# Save the current state of the working directory
git stash push --quiet
# Checkout the base branch/commit
git checkout --force --quiet -b ci_br_dest "${BASE}" || git checkout --force --quiet "${BASE}"

Expand All @@ -87,6 +89,8 @@ echo

# Checkout the head branch/commit, it's required in order to correctly display defects in console
git checkout --force --quiet -
# Restore the working directory to the state before the checkout
git stash pop --quiet

evaluate_and_print_defects
exit_status=$?
Expand Down

0 comments on commit f5809a9

Please sign in to comment.