aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plumbing/transport/git/common.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/plumbing/transport/git/common.go b/plumbing/transport/git/common.go
index 753f125..6776b69 100644
--- a/plumbing/transport/git/common.go
+++ b/plumbing/transport/git/common.go
@@ -90,7 +90,12 @@ func (c *command) StdoutPipe() (io.Reader, error) {
}
func endpointToCommand(cmd string, ep transport.Endpoint) string {
- return fmt.Sprintf("%s %s%chost=%s%c", cmd, ep.Path(), 0, ep.Host(), 0)
+ host := ep.Host()
+ if ep.Port() != DefaultPort {
+ host = fmt.Sprintf("%s:%d", ep.Host(), ep.Port())
+ }
+
+ return fmt.Sprintf("%s %s%chost=%s%c", cmd, ep.Path(), 0, host, 0)
}
// Wait no-op function, required by the interface