diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-02-19 12:01:36 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-02-19 12:03:20 +0000 |
commit | e05d0df704a0f4ccfddc040c7e451fdd2370f050 (patch) | |
tree | acc7a39dc905a47258e9c9975e610bbeeb1f8fce | |
parent | 7c7293dd644f77c788acea62fab77cd2637bb50e (diff) |
jenkins-helpers.sh: Remove stale locks in git repos.
We get locks in git repo when builds are interrupted during
git remote update.
Change-Id: I184f6e0f4e401237d85f0e0af328a67be654faec
-rw-r--r-- | jenkins-helpers.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index 36b7cd2f..adcbe352 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -405,6 +405,9 @@ clone_or_update_repo_no_checkout () # Also, prune all loose objects to avoid "git gc --auto" failing # and creating .git/gc.log, which will stop future "git gc --auto" runs. git -C "$dir" gc --auto --force --prune=all + # Delete stale locks -- especially .git/refs/remotes/REMOTE/BRANCH.lock + # These occur when builds are aborted during "git remote update" or similar. + find "$dir/.git" -name "*.lock" -delete fi ( |