Skip to content
Commit b4bee06a authored by Dato Simó's avatar Dato Simó Committed by Richard Hartmann
Browse files

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
parent 75c4c554
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment