File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
qgis_deployment_toolbelt/profiles Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ def _is_local_path_git_repository(
179
179
local_path : Path = self .SOURCE_REPOSITORY_PATH_OR_URL
180
180
181
181
try :
182
- Repo ( root = f"{ local_path .resolve ()} " )
182
+ porcelain . open_repo_closing ( f"{ local_path .resolve ()} " )
183
183
return True
184
184
except NotGitRepository as err :
185
185
if not raise_error :
@@ -253,7 +253,7 @@ def get_active_branch_from_local_repository(
253
253
)
254
254
255
255
return porcelain .active_branch (
256
- repo = Repo ( root = f"{ local_git_repository_path .resolve ()} " )
256
+ repo = f"{ local_git_repository_path .resolve ()} "
257
257
).decode ()
258
258
259
259
def is_branch_existing_in_repository (
@@ -506,8 +506,8 @@ def _clone(self, local_path: Path) -> Repo:
506
506
if self .SOURCE_REPOSITORY_TYPE in ("git_local" , "local" ):
507
507
with porcelain .open_repo_closing (
508
508
path_or_repo = self .SOURCE_REPOSITORY_PATH_OR_URL .as_posix ()
509
- ) as repo_obj :
510
- repo_obj .clone (
509
+ ) as src_repo_obj :
510
+ repo_obj = src_repo_obj .clone (
511
511
target_path = f"{ local_path .resolve ()} " ,
512
512
branch = branch ,
513
513
mkdir = False ,
@@ -529,6 +529,7 @@ def _clone(self, local_path: Path) -> Repo:
529
529
f"Latest commit cloned: { gobj .sha ().hexdigest ()} by { gobj .author } "
530
530
f" at { gobj .commit_time } ."
531
531
)
532
+ repo_obj .close ()
532
533
return repo_obj
533
534
534
535
@proxies .os_env_proxy
You can’t perform that action at this time.
0 commit comments