From e211a3ec5992f0e996664264fcfaf139c0d97228 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 21 Dec 2020 19:40:12 +0100 Subject: 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 --- bin/git-ggc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bin') 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) { -- cgit v1.2.1