Clean non-bare remote repos

In case of reused workspaces on static nodes remote
non-bare repos needs to be cleaned up to make sure
that any untracked files from any earlier jobs are removed.

Change-Id: I00dda298f499b241a224c19657ebbb8a9015eb4d
This commit is contained in:
Albin Vass 2019-09-06 15:30:17 +02:00 committed by James E. Blair
parent 91a0d9b312
commit 110dcaacf9

View File

@ -29,6 +29,8 @@
shell: | shell: |
# Reset is needed because we pushed to a non-bare repo # Reset is needed because we pushed to a non-bare repo
git reset --hard git reset --hard
# Clean is needed because we pushed to a non-bare repo
git clean -xdf
# Undo the config setting we did above # Undo the config setting we did above
git config --local --unset receive.denyCurrentBranch git config --local --unset receive.denyCurrentBranch
# checkout the branch matching the branch set up by the executor # checkout the branch matching the branch set up by the executor