Skip to content

Commit

Permalink
Check if repository_path is already initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanBryan51 committed Apr 30, 2024
1 parent 9034b12 commit 09272ae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/benchcab/utils/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ def __init__(
"""
self.url = url
self.branch = branch
is_bare_directory = realisation_path.is_dir() and (

Check warning on line 140 in src/benchcab/utils/repo.py

View check run for this annotation

Codecov / codecov/patch

src/benchcab/utils/repo.py#L140

Added line #L140 was not covered by tests
not (realisation_path / ".git").exists()
)
self.realisation_path = (
realisation_path / branch if realisation_path.is_dir() else realisation_path
realisation_path / branch if is_bare_directory else realisation_path
)
self.commit = commit
self.logger = get_logger()
Expand Down Expand Up @@ -223,9 +226,12 @@ def __init__(
self.svn_root = svn_root
self.branch_path = branch_path
self.revision = revision
is_bare_directory = realisation_path.is_dir() and (

Check warning on line 229 in src/benchcab/utils/repo.py

View check run for this annotation

Codecov / codecov/patch

src/benchcab/utils/repo.py#L229

Added line #L229 was not covered by tests
not (realisation_path / ".svn").exists()
)
self.realisation_path = (
realisation_path / Path(branch_path).name
if realisation_path.is_dir()
if is_bare_directory
else realisation_path
)
self.logger = get_logger()
Expand Down

0 comments on commit 09272ae

Please sign in to comment.