diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-12-24 16:27:59 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-01-11 11:24:17 +0000 |
commit | b5cd9b277dda5751358d45f279557eb099ed90ab (patch) | |
tree | 5725ff77d118c389db471789cfa079de7b6c1207 | |
parent | e0186558c066876c79be6617d2253b12ff39da0b (diff) |
jenkins-helpers.sh: Run "git gc" when updating git repos.
This avoids git repos from growing too large.
Change-Id: I2cd9b83180ca13557a0aa5558d5019a98b81833b
-rw-r--r-- | jenkins-helpers.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index db20f32e..8a906056 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -345,6 +345,10 @@ clone_or_update_repo_no_checkout () if ! [ -d "$dir/.git" ]; then rm -rf "$dir" run_with_timeout_and_retry 1h 3 git clone $refopt "$url" "$dir" + else + # Clean up the clone (this is supposed to re-share objects from + # reference clone and keep the size of the clone minimal). + git -C "$dir" gc fi ( |