Log commit SHA when getting files from repo

From the previous log messages related to a cat job it wasn't clear
which HEAD SHA was used to get the file content.

This change adds a log message to the `getFiles()` method that contains
the HEAD commit SHA.

Change-Id: I02a3a97f9b3dfa70f6e55954ea6ef365289f0046
This commit is contained in:
Simon Westphahl
2023-03-24 11:34:48 +01:00
parent dd8ad88b8e
commit 183d221124
+4 -2
View File
@@ -722,9 +722,11 @@ class Repo(object):
ret = {}
repo = self.createRepoObject(zuul_event_id)
if branch:
tree = repo.heads[branch].commit.tree
head = repo.heads[branch].commit
else:
tree = repo.commit(commit).tree
head = repo.commit(commit)
log.debug("Getting files for %s at %s", self.local_path, head.hexsha)
tree = head.tree
for fn in files:
if fn in tree:
if tree[fn].type != 'blob':