vcsh: strip host part from GIT_REMOTE when inferring VCSH_REPO_NAME
`vcsh clone` does:
VCSH_REPO_NAME=$(basename "${GIT_REMOTE}" .git)
Typically, most remote paths will have a non-empty directory component,
so using basename works well in all common cases. However, when doing
something like:
% vcsh clone example.org:repo.git
VCSH_REPO_NAME will be set to "example.org:repo" instead of "repo". This
also happens when using url.<x>.insteadOf, à-la:
% vcsh clone v:repo
Stripping everything up to the first colon in the remote URL fixes the
issue.
N.B.: remote URLs with protocol (e.g. http://, git://, or ssh://) do
not exhibit this problem, and are unaffected by this change.
Conflicts:
vcsh
Loading
Please sign in to comment