Skip to content

Commit 488b1dc

Browse files
committed
Update from deprecated transport.Endpoint API
Signed-off-by: Paulo Gomes <[email protected]>
1 parent ef0b838 commit 488b1dc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/gogit/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,15 @@ func main() {
5555
}
5656

5757
func defaultAuth(ep *transport.Endpoint) transport.AuthMethod {
58-
switch ep.Protocol {
58+
switch ep.Scheme {
5959
case "file", "git":
6060
// Do nothing.
6161
case "ssh":
62-
a, err := ssh.NewSSHAgentAuth(ep.User)
62+
if ep.User == nil {
63+
return nil
64+
}
65+
66+
a, err := ssh.NewSSHAgentAuth(ep.User.Username())
6367
if err != nil {
6468
return nil
6569
}

0 commit comments

Comments
 (0)