Skip to content

Commit 80f821a

Browse files
Fix issue where '.git' is required in clone URLs
1 parent c4f01a7 commit 80f821a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitprof/cli/clone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def do_clone(
7979
@click.argument("repo")
8080
@click.option("-p", "--profile", help="Which profile to clone the repo with")
8181
def clone(repo: str, profile: str):
82-
profile = command_utils.choose_profile_interactive(
82+
profile: Profile = command_utils.choose_profile_interactive(
8383
profile, title="Choose a profile to clone with"
8484
)
8585

@@ -110,7 +110,7 @@ def clone(repo: str, profile: str):
110110
print(f"Error: can't find your SSH key at '{ssh_key}'.")
111111
sys.exit(1)
112112

113-
dest = re.findall(r".*/(.*?)\.git", repo)[0]
113+
dest = re.findall(r"^.*/(.*?)(?:\.git)?$", repo)[0]
114114
ssh_command = ssh.get_ssh_command(ssh_key)
115115

116116
do_clone(ssh_command, repo, dest)

0 commit comments

Comments
 (0)