Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 47fc5cb

Browse files
committed
transport: ssh, fixes override HostKeyCallback from DefaultClient
Signed-off-by: Máximo Cuadros <[email protected]>
1 parent 5cf1147 commit 47fc5cb

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Diff for: plumbing/transport/ssh/common.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ func overrideConfig(overrides *ssh.ClientConfig, c *ssh.ClientConfig) {
154154
f := t.Field(i)
155155
vcf := vc.FieldByName(f.Name)
156156
vof := vo.FieldByName(f.Name)
157-
if isZeroValue(vcf) {
158-
vcf.Set(vof)
159-
}
157+
vcf.Set(vof)
160158
}
161159

162160
*c = vc.Interface().(ssh.ClientConfig)

Diff for: plumbing/transport/ssh/common_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ func (s *SuiteCommon) TestOverrideConfigKeep(c *C) {
3737
}
3838

3939
overrideConfig(config, target)
40-
c.Assert(target.User, Equals, "bar")
40+
c.Assert(target.User, Equals, "foo")
4141
}

0 commit comments

Comments
 (0)