summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jenkins-helpers.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index 95962efd..9bf6f69e 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -386,7 +386,10 @@ clone_or_update_repo_no_checkout ()
# a lock. Use --force to workaround that. It should be safe
# to override the lock since directories should not be shared
# between concurrent builds.
- git -C "$dir" gc --auto --force
+ #
+ # 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
fi
(