Skip to content

Commit

Permalink
fix errors in gcm management
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercoms committed Aug 22, 2024
1 parent 8d6a288 commit 9a66f1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pbpy/pbgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ def get_gcm_executable(recursed=False):
[get_git_executable(), "config", "--get", "credential.helper"]
).replace("\\", "")
# no helper installed
# TODO: remove -core suffix once deprecated
if not gcm_exec:
# try setting GCM
if not recursed:
pbtools.run(["git", "config", "credential.helper", "manager-core"])
pbtools.run(["git", "config", "credential.helper", "manager"])
return get_gcm_executable(recursed=True)
return None
# old style
Expand All @@ -76,7 +75,7 @@ def get_gcm_executable(recursed=False):
# helper installed, but not GCM
if "git-credential-manager" not in gcm_exec:
if not recursed:
pbtools.run(["git", "config", "credential.helper", "manager-core"])
pbtools.run(["git", "config", "credential.helper", "manager"])
return get_gcm_executable(recursed=True)
return [f"diff.{gcm_exec}"]
return [gcm_exec]
Expand Down
4 changes: 2 additions & 2 deletions pbsync/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def sync_handler(sync_val: str, repository_val=None):
else:
needs_git_update = False
# reconfigure credential manager to make sure we have the proper path
pbtools.run(["git", "credential-manager", "configure"])
pbtools.run([*pbgit.get_gcm_executable(), "configure"])
os.remove(download_path)
else:
proc = pbtools.run(
Expand Down Expand Up @@ -363,7 +363,7 @@ def sync_handler(sync_val: str, repository_val=None):
)
else:
# reconfigure credential manager to make sure we have the proper path
pbtools.run(["git", "credential-manager", "configure"])
pbtools.run([*pbgit.get_gcm_executable(), "configure"])
needs_git_update = False
os.remove(download_path)

Expand Down

0 comments on commit 9a66f1b

Please sign in to comment.