Skip to content

Commit

Permalink
Merge pull request #208 from openlawlibrary/renatav/no-targets-fix
Browse files Browse the repository at this point in the history
Return an empty list of targets if the targets folder does not exist
  • Loading branch information
n-dusan authored Feb 10, 2022
2 parents fd99b88 + e0e600f commit 7d6bbf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ and this project adheres to [Semantic Versioning][semver].


### Fixed
- Update handler fix: return an empty list of targets if the targets folder does not exist ([208])
- pytest works when taf installed via wheel ([200])

[208]: https://github.com/openlawlibrary/taf/pull/208
[207]: https://github.com/openlawlibrary/taf/pull/207
[200]: https://github.com/openlawlibrary/taf/pull/200

Expand Down
9 changes: 6 additions & 3 deletions taf/updater/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d6bbf0

Please sign in to comment.