Skip to content

Commit

Permalink
docs: GitStorageBackend docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
renatav committed Dec 4, 2024
1 parent 7db3588 commit 6410f52
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions taf/tuf/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def is_subpath(path, potential_subpath):


def find_git_repository(inner_path):
"""
Instantiates a git repository based on a path
that is expected to be inside that repository.
Enables smoother integration with TUF's default
FilesystemBackend implementation
"""
for path in list(git_repos_cache.keys()):
if is_subpath(inner_path, path):
return git_repos_cache[path]
Expand All @@ -51,6 +57,12 @@ def find_git_repository(inner_path):


class GitStorageBackend(FilesystemBackend):
"""
Storage backend implemnantation that loads data
from a specific commit, if it is specified,
or from the filesystem, if the commit is None
Extends TUF's FilesystemBackend.
"""

commit: Optional[str] = None

Expand Down

0 comments on commit 6410f52

Please sign in to comment.