Skip to content

Commit 98afcc4

Browse files
Accept both git@ and ssh://
1 parent 6e6e269 commit 98afcc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sagemaker/git_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _clone_command_for_github_like(git_config, dest_dir):
174174
CalledProcessError: If failed to clone git repo.
175175
"""
176176
is_https = git_config["repo"].startswith("https://")
177-
is_ssh = git_config["repo"].startswith("git@")
177+
is_ssh = git_config["repo"].startswith("git@") or git_config["repo"].startswith("ssh://")
178178
if not is_https and not is_ssh:
179179
raise ValueError("Invalid Git url provided.")
180180
if is_ssh:
@@ -277,7 +277,7 @@ def _run_clone_command(repo_url, dest_dir):
277277
if repo_url.startswith("https://"):
278278
my_env["GIT_TERMINAL_PROMPT"] = "0"
279279
subprocess.check_call(["git", "clone", repo_url, dest_dir], env=my_env)
280-
elif repo_url.startswith("git@"):
280+
elif repo_url.startswith("git@") or repo_url.startswith("ssh://"):
281281
with tempfile.NamedTemporaryFile() as sshnoprompt:
282282
with open(sshnoprompt.name, "w") as write_pipe:
283283
write_pipe.write("ssh -oBatchMode=yes $@")

0 commit comments

Comments
 (0)