[projects/git-slug: 148/170] Print header only when something has been fetched
glen
glen at pld-linux.org
Mon Sep 21 21:51:15 CEST 2015
commit 2cf9de3641fb244b319eaf062317f3e053e60f33
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Tue Nov 20 14:04:04 2012 +0000
Print header only when something has been fetched
The algorithm to discover if there is something to fetch can sometimes
give false positive, as the remote heads can be packed. So sometimes the
header was printed even when nothing has been fetched.
slug.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/slug.py b/slug.py
index fe09bb0..6f4e441 100755
--- a/slug.py
+++ b/slug.py
@@ -46,7 +46,8 @@ class ThreadFetch(threading.Thread):
(gitrepo, ref2fetch) = self.queue.get()
try:
(stdout, stderr) = gitrepo.fetch(ref2fetch, self.depth)
- print('------', gitrepo.gdir[:-len('.git')], '------\n' + stderr.decode('utf-8'))
+ if stderr != b'':
+ print('------', gitrepo.gdir[:-len('.git')], '------\n' + stderr.decode('utf-8'))
except GitRepoError as e:
print('------', gitrepo.gdir[:-len('.git')], '------\n', e)
self.queue.task_done()
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5
More information about the pld-cvs-commit
mailing list