8000 plumbing: fix unintended pointer mutation in test · go-git/go-git@9bbc93b · GitHub
[go: up one dir, main page]

Skip to content

Commit 9bbc93b

Browse files
committed
plumbing: fix unintended pointer mutation in test
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 parent f3783f4 commit 9bbc93b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plumbing/transport/http/common_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ func (s *ClientSuite) TestNewUnexpectedError(c *C) {
111111

112112
func (s *ClientSuite) Test_newSession(c *C) {
113113
cl := NewClientWithOptions(nil, &ClientOptions{
114-
CacheMaxEntries: 2,
114+
CacheMaxEntries: 3,
115115
}).(*client)
116116

117-
insecureEP := s.Endpoint
117+
insecureEP := *s.Endpoint
118118
insecureEP.InsecureSkipTLS = true
119-
session, err := newSession(cl, insecureEP, nil)
119+
session, err := newSession(cl, &insecureEP, nil)
120120
c.Assert(err, IsNil)
121121

122122
sessionTransport := session.client.Transport.(*http.Transport)
@@ -131,7 +131,7 @@ func (s *ClientSuite) Test_newSession(c *C) {
131131

132132
caEndpoint := insecureEP
133133
caEndpoint.CaBundle = []byte("this is the way")
134-
session, err = newSession(cl, caEndpoint, nil)
134+
session, err = newSession(cl, &caEndpoint, nil)
135135
c.Assert(err, IsNil)
136136

137137
sessionTransport = session.client.Transport.(*http.Transport)
@@ -146,7 +146,7 @@ func (s *ClientSuite) Test_newSession(c *C) {
146146
// cached transport should be the one that's used.
147147
c.Assert(sessionTransport, Equals, t)
148148

149-
session, err = newSession(cl, caEndpoint, nil)
149+
session, err = newSession(cl, &caEndpoint, nil)
150150
c.Assert(err, IsNil)
151151
sessionTransport = session.client.Transport.(*http.Transport)
152152
// transport that's going to be used should be cached already.
@@ -156,7 +156,7 @@ func (s *ClientSuite) Test_newSession(c *C) {
156156

157157
// if the cache does not exist, the transport should still be correctly configured.
158158
cl.transports = nil
159-
session, err = newSession(cl, insecureEP, nil)
159+
session, err = newSession(cl, &insecureEP, nil)
160160
c.Assert(err, IsNil)
161161

162162
sessionTransport = session.client.Transport.(*http.Transport)

0 commit comments

Comments
 (0)
0