I have a GUI application that uses the pythongit library to perform updates. When a user is authenticating with a SSH key to the repository the updates works smoothly, but when a username/password authentication is used, then a prompt will appear on the terminal where the application was started (leaving the user with the GUI interface open thinking it's frozen).
Is there a way to determine if the repo is using SSH or password authentication and then possibly manually prompt for a username/password first and passing it to the fetch call?
Here is the basic functionality:
def repo_pull(self, git_path):
try:
repo = Repo(git_path)
except InvalidGitRepositoryError as igre:
raise ValueError('Get the project as a Git repository (no archives)')
commits_ahead = repo.iter_commits('origin/master..master')
if sum(1 for c in commits_ahead) > 0:
raise ValueError("Can't pull from git; local repository has unpushed commits!")
origin = repo.remote()
try:
origin.fetch()
except GitCommandError as gce:
,,,