• Ingo Oeser's avatar
    cmd/go: simplify/fix handling private github repos · 668762c5
    Ingo Oeser authored
    Before Go 1.4, the traditional way to work with a private Github
    repository was to run something similar the following:
    
    ```
    git config --global url."git@github.com:".insteadOf "https://github.com/"
    ```
    
    It would allow go get and friends to transparently work as expected,
    automatically rewriting https URLs to use SSH for auth. This worked both
    when pushing and pulling.
    
    In Go 1.4 this broke, now requiring the use of `go get -f` instead of `go get`
    in order to fetch private repositories. This seems neither intended nor
    practical, as it requires changing a lot of tooling.
    
    So just use `git config remote.origin.url` instead of `git remote -v` as
    this reflects the actual substitution intended in the `insteadOf` config
    directive.
    
    Also remove now useless parsing.
    
    Also add a check against supported schemes to avoid errors in later
    commands using this URL and expecting such a scheme.
    
    Fixes #9697
    
    Change-Id: I907327f83504302288f913a68f8222a5c2d673ee
    Reviewed-on: https://go-review.googlesource.com/3504Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
    668762c5
Name
Last commit
Last update
..
5a Loading commit data...
5g Loading commit data...
5l Loading commit data...
6a Loading commit data...
6g Loading commit data...
6l Loading commit data...
8a Loading commit data...
8g Loading commit data...
8l Loading commit data...
9a Loading commit data...
9g Loading commit data...
9l Loading commit data...
addr2line Loading commit data...
api Loading commit data...
cc Loading commit data...
cgo Loading commit data...
dist Loading commit data...
fix Loading commit data...
gc Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
ld Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
yacc Loading commit data...