feat: merge geekan:cli-etc

This commit is contained in:
莘权 马 2023-11-29 20:58:41 +08:00
parent 09b6d2df83
commit 6fa3deef00
2 changed files with 13 additions and 16 deletions

View file

@ -59,6 +59,7 @@ class GitRepository:
:param local_path: The local path to the Git repository.
:param auto_init: If True, automatically initializes a new Git repository if the provided path is not a Git repository.
"""
local_path = Path(local_path)
if self.is_git_dir(local_path):
self._repository = Repo(local_path)
return