From b5dbcbc6ef45a4107502d56a23c895c27d614276 Mon Sep 17 00:00:00 2001 From: Renata <rvaderna@openlawlib.org> Date: Thu, 10 Feb 2022 21:47:48 +0100 Subject: [PATCH] Return an empty list of targets if the targets folder does not exist --- taf/updater/handlers.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/taf/updater/handlers.py b/taf/updater/handlers.py index 6adef7944..707df086b 100644 --- a/taf/updater/handlers.py +++ b/taf/updater/handlers.py @@ -285,9 +285,12 @@ def ensure_not_changed(self, metadata_filename): ) def get_current_targets(self): - return self.validation_auth_repo.list_files_at_revision( - self.current_commit, "targets" - ) + try: + return self.validation_auth_repo.list_files_at_revision( + self.current_commit, "targets" + ) + except GitError: + return [] def get_mirrors(self, _file_type, _file_path): # pylint: disable=unused-argument