diff options
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r-- | jenkins-helpers.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index 771ef037..26151090 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -481,14 +481,14 @@ clone_or_update_repo_no_checkout () rm -rf "$dir" fi - if [ -d "$dir" ] && [ x"$refopt" != x"" ] \ - && [ "$(du -s "$dir/.git" | cut -f 1)" -gt $((1024*1024)) ]; then - # Current clone has grown above 1GB, and we have a reference repo, - # which should cut down the size significantly. - # Redo the clone to save disk space. - # PS: Unfortunately, I could not find a way to make the current clone - # use new objects from the reference repo without a full re-clone. - # Fortunately, a new clone with a reference repo is quick. + if [ -d "$dir" ] \ + && [ "$(du -s "$dir/.git" | cut -f 1)" -gt $((1024*1024)) ] \ + && { [ x"$refopt" != x"" ] || [ x"$single_branch" != x"" ]; }; then + # Current clone has grown above 1GB, and we have a reference repo + # (which should cut down the size significantly) or we are asked + # to clone a single branch (which usually means that cloning all + # branches is expensive -- this is for base-artifacts repo, mostly). + # We redo the clone to save disk space. rm -rf "$dir" fi |