Skip to content

Commit 60cf11a

Browse files
authored
Merge pull request #796 from fluxcd/libgit2-req-incomplete-auth-test
libgit2/managed/http: test for incomplete creds
2 parents bc28ad5 + 7325430 commit 60cf11a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/git/libgit2/managed/http_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ func TestHttpAction_CreateClientRequest(t *testing.T) {
105105
},
106106
wantedErr: nil,
107107
},
108+
{
109+
name: "incomplete credentials, no basic auth",
110+
action: git2go.SmartServiceActionReceivepackLs,
111+
transport: &http.Transport{},
112+
authOpts: git.AuthOptions{Username: "user"},
113+
assertFunc: func(g *WithT, req *http.Request, client *http.Client) {
114+
_, _, ok := req.BasicAuth()
115+
g.Expect(ok).To(BeFalse())
116+
},
117+
},
108118
{
109119
name: "credentials are correctly configured",
110120
action: git2go.SmartServiceActionUploadpack,

0 commit comments

Comments
 (0)