Skip to content

Commit 991e4a8

Browse files
sienkssienks
andauthored
fix: correct SSH URL format for private repos (#721)
Co-authored-by: sienks <[email protected]>
1 parent 9a3e5c9 commit 991e4a8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

zinit-install.zsh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,15 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
416416
case ${ICE[proto]} in
417417
(|ftp(|s)|git|http(|s)|rsync|ssh)
418418
:zinit-git-clone() {
419+
local clone_url
420+
if [[ ${ICE[proto]} == "ssh" ]]; then
421+
clone_url="git@${site:-${ICE[from]:-github.com}}:$remote_url_path"
422+
else
423+
clone_url="${ICE[proto]:-https}://${site:-${ICE[from]:-github.com}}/$remote_url_path"
424+
fi
419425
command git clone --progress ${(s: :)ICE[cloneopts]---recursive} \
420426
${(s: :)ICE[depth]:+--depth ${ICE[depth]}} \
421-
"${ICE[proto]:-https}://${site:-${ICE[from]:-github.com}}/$remote_url_path" \
427+
"$clone_url" \
422428
"$local_path" \
423429
--config transfer.fsckobjects=false \
424430
--config receive.fsckobjects=false \

0 commit comments

Comments
 (0)