fix(git): fix repository detection in `gccd` function (#12023)

Fixes #12023
parent 632ed413
...@@ -166,6 +166,8 @@ alias gclean='git clean --interactive -d' ...@@ -166,6 +166,8 @@ alias gclean='git clean --interactive -d'
alias gcl='git clone --recurse-submodules' alias gcl='git clone --recurse-submodules'
function gccd() { function gccd() {
setopt localoptions extendedglob
# get repo URI from args based on valid formats: https://git-scm.com/docs/git-clone#URLS # get repo URI from args based on valid formats: https://git-scm.com/docs/git-clone#URLS
local repo="${${@[(r)(ssh://*|git://*|ftp(s)#://*|http(s)#://*|*@*)(.git/#)#]}:-$_}" local repo="${${@[(r)(ssh://*|git://*|ftp(s)#://*|http(s)#://*|*@*)(.git/#)#]}:-$_}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment