diff options
author | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2020-12-21 19:40:12 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2021-05-18 11:02:12 +0000 |
commit | e211a3ec5992f0e996664264fcfaf139c0d97228 (patch) | |
tree | 08b68709a88e220083fe7ab61b4e2b7c8f7a770e /bin | |
parent | 84a022344a0f4986f58c690eb933da480a59957f (diff) | |
download | qtrepotools-e211a3ec5992f0e996664264fcfaf139c0d97228.tar.gz |
ggc: setup gerrit config only if querying changes
this avoids pointless error messages if one always uses git-gpull even
while not having a writable remote set up.
Change-Id: Id868612a2a0d441b92554dc7d25478831acb9089
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/git-ggc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/git-ggc b/bin/git-ggc index 0c28f3f..5aa686e 100755 --- a/bin/git-ggc +++ b/bin/git-ggc @@ -217,10 +217,11 @@ sub perform_gc() } } - print "Querying Gerrit for prunable Changes ...\n" if ($debug); - get_gerrit_config(); - query_gerrit_pull([ map { "change:".$_ } (keys %zap_ids, keys %fzaps) ]) - if (%zap_ids || %fzaps); + if (%zap_ids || %fzaps) { + print "Querying Gerrit for prunable Changes ...\n" if ($debug); + get_gerrit_config(); + query_gerrit_pull([ map { "change:".$_ } (keys %zap_ids, keys %fzaps) ]); + } print "Pruning stale Changes ...\n" if ($debug); foreach my $key (sort keys %change_by_key) { |