From 47fc5cbffe92111d8737de8120f168bab4f5c539 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 20 Nov 2017 15:26:47 +0100 Subject: transport: ssh, fixes override HostKeyCallback from DefaultClient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Máximo Cuadros --- plumbing/transport/ssh/common.go | 4 +--- plumbing/transport/ssh/common_test.go | 2 +- 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") } -- cgit