aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/ssh
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-11-20 15:26:47 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-11-20 15:26:47 +0100
commit47fc5cbffe92111d8737de8120f168bab4f5c539 (patch)
treed545c5e557ea49b4b6b23a13b37e6fbdb6061455 /plumbing/transport/ssh
parent5cf1147e1b891aee85fdd66d24cb5e8cf86531ce (diff)
downloadgo-git-47fc5cbffe92111d8737de8120f168bab4f5c539.tar.gz
transport: ssh, fixes override HostKeyCallback from DefaultClient
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
Diffstat (limited to 'plumbing/transport/ssh')
-rw-r--r--plumbing/transport/ssh/common.go4
-rw-r--r--plumbing/transport/ssh/common_test.go2
2 files changed, 2 insertions, 4 deletions
diff --git a/plumbing/transport/ssh/common.go b/plumbing/transport/ssh/common.go
index af79dfb..a844c78 100644
--- a/plumbing/transport/ssh/common.go
+++ b/plumbing/transport/ssh/common.go
@@ -154,9 +154,7 @@ func overrideConfig(overrides *ssh.ClientConfig, c *ssh.ClientConfig) {
f := t.Field(i)
vcf := vc.FieldByName(f.Name)
vof := vo.FieldByName(f.Name)
- if isZeroValue(vcf) {
- vcf.Set(vof)
- }
+ vcf.Set(vof)
}
*c = vc.Interface().(ssh.ClientConfig)
diff --git a/plumbing/transport/ssh/common_test.go b/plumbing/transport/ssh/common_test.go
index 1b07eee..5315e28 100644
--- a/plumbing/transport/ssh/common_test.go
+++ b/plumbing/transport/ssh/common_test.go
@@ -37,5 +37,5 @@ func (s *SuiteCommon) TestOverrideConfigKeep(c *C) {
}
overrideConfig(config, target)
- c.Assert(target.User, Equals, "bar")
+ c.Assert(target.User, Equals, "foo")
}