Clarify that for pygit2, receiving 0 objects means repo is up-to-date

This seems to be too confusing to users, so this changes the log message
to say that the repo is up-to-date instead of saying that 0 objects were
received.
This commit is contained in:
Erik Johnson 2015-04-17 22:11:40 -05:00
parent 98885f71d6
commit 8f1c0084cd

View file

@ -1169,10 +1169,16 @@ def update():
# pygit2.Remote.fetch() returns a class instance in
# pygit2 >= 0.21.0
received_objects = fetch.received_objects
log.debug(
'gitfs received {0} objects for remote {1}'
.format(received_objects, repo['url'])
)
if received_objects != 0:
log.debug(
'gitfs received {0} objects for remote {1}'
.format(received_objects, repo['url'])
)
else:
log.debug(
'gitfs remote {0} is up-to-date'
.format(repo['url'])
)
# Clean up any stale refs
refs_post = repo['repo'].listall_references()
cleaned = _clean_stale(repo['repo'], refs_post)