Detector: almost complete
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
@@ -218,6 +218,24 @@ class RepoTool:
|
||||
def list_commits(self, max_depth: Optional[int] = None):
|
||||
return self._repo.iter_commits(all = True, max_count = max_depth, reverse = True)
|
||||
|
||||
@__check_initialized
|
||||
def list_branches(self) -> Union[dict, bool]:
|
||||
log.debug(f"Listing branches of repo")
|
||||
branches = {}
|
||||
for branch in self._repo.branches:
|
||||
branches[branch.name] = branch.commit.hexsha
|
||||
log.debug(f"Found {len(branches)}")
|
||||
return branches
|
||||
|
||||
@__check_initialized
|
||||
def list_tags(self):
|
||||
log.debug(f"Listing tags of repo")
|
||||
tags = {}
|
||||
for tag in self._repo.tags:
|
||||
tags[tag.name] = tag.commit.hexsha
|
||||
log.debug(f"Found {len(tags)} tags")
|
||||
return tags
|
||||
|
||||
@__check_initialized
|
||||
def list_submodules(self, commit: str = "HEAD") -> Union[list, bool]:
|
||||
commit = self._repo.commit(commit)
|
||||
|
||||
Reference in New Issue
Block a user