From: Russ Cox Date: Thu, 17 Dec 2015 06:53:47 +0000 (-0500) Subject: cmd/go: allow ~ as first char of path element in general git import paths X-Git-Tag: go1.6beta1~20 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0d641c754f73a71ffd21a9f9d58ea3fe38d727b4;p=gostls13.git cmd/go: allow ~ as first char of path element in general git import paths This makes go get gitserver/~user/repo.git/foo work. Fixes #9193. Change-Id: I8c9d4096903288f7f0e82d6ed1aa78bf038fb81a Reviewed-on: https://go-review.googlesource.com/17952 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/go/vcs.go b/src/cmd/go/vcs.go index 316a7ec79d..946b6ae7bf 100644 --- a/src/cmd/go/vcs.go +++ b/src/cmd/go/vcs.go @@ -885,7 +885,7 @@ var vcsPaths = []*vcsPath{ // General syntax for any server. // Must be last. { - re: `^(?P(?P([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?Pbzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$`, + re: `^(?P(?P([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?(/~?[A-Za-z0-9_.\-]+)+?)\.(?Pbzr|git|hg|svn))(/~?[A-Za-z0-9_.\-]+)*$`, ping: true, }, }