From 78cff47a911a438975fce524fa5edd2285c2e06b Mon Sep 17 00:00:00 2001 From: Albert Wang Date: Sat, 15 Aug 2020 17:26:04 -0700 Subject: [PATCH] Fix regex string --- github_backup/github_backup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github_backup/github_backup.py b/github_backup/github_backup.py index a1e1a20..68bfb59 100644 --- a/github_backup/github_backup.py +++ b/github_backup/github_backup.py @@ -423,8 +423,8 @@ def get_github_repo_url(args, repository): if repository.get('is_gist'): if args.prefer_ssh: # The git_pull_url value is always https for gists, so we need to transform it to ssh form - repo_url = re.sub('^https?:\/\/(.+)\/(.+)\.git$', r'git@\1:\2.git', repository['git_pull_url']) - repo_url = re.sub('^git@gist\.', 'git@', repo_url) # strip gist subdomain for better hostkey compatibility + repo_url = re.sub(r'^https?:\/\/(.+)\/(.+)\.git$', r'git@\1:\2.git', repository['git_pull_url']) + repo_url = re.sub(r'^git@gist\.', 'git@', repo_url) # strip gist subdomain for better hostkey compatibility else: repo_url = repository['git_pull_url'] return repo_url