Skip to content

Commit a614131

Browse files
author
Tjaz Erzen
committed
Simplify method has_commit_for_frid
1 parent 6d29997 commit a614131

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

git_utils.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -299,24 +299,8 @@ def _get_commit_with_frid(
299299
)
300300

301301

302-
def has_commit_for_frid(
303-
repo_path: Union[str, os.PathLike], frid: str, module_name: Optional[str] = None
304-
) -> bool:
305-
"""
306-
Check if a commit exists for the given FRID in the repository.
307-
308-
Args:
309-
repo_path (str | os.PathLike): Path to the git repository
310-
frid (str): Functional requirement ID to check
311-
312-
Returns:
313-
bool: True if the commit exists, False otherwise
314-
"""
315-
repo = Repo(repo_path)
316-
commit_with_frid = _get_commit_with_frid(repo, frid, module_name)
317-
if not commit_with_frid:
318-
return False
319-
return True
302+
def has_commit_for_frid(repo_path: Union[str, os.PathLike], frid: str, module_name: Optional[str] = None) -> bool:
303+
return bool(_get_commit_with_frid(Repo(repo_path), frid, module_name))
320304

321305

322306
def _get_base_folder_commit(repo: Repo) -> str:

0 commit comments

Comments
 (0)