libkas: Improve reporting of repo_fetch

Instead of writing "commit", issue a more telling log message if some
repo already contains the required hash.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2017-06-28 12:43:54 +02:00 committed by Daniel Wagner
parent e9feb07567
commit dddbdb0112

View File

@ -174,8 +174,10 @@ def repo_fetch(config, repo):
# Does refspec exist in the current repository?
(retc, output) = run_cmd(['/usr/bin/git', 'cat-file',
'-t', repo.refspec], env=config.environ,
cwd=repo.path, fail=False)
cwd=repo.path, fail=False, liveupdate=False)
if retc == 0:
logging.info('Repository %s already contains %s as %s',
repo.name, repo.refspec, output.strip())
return
# No it is missing, try to fetch