@@ -30,6 +30,8 @@ import (
30
30
. "github.com/onsi/gomega"
31
31
32
32
"github.com/fluxcd/source-controller/pkg/git"
33
+
34
+ mt "github.com/fluxcd/source-controller/pkg/git/libgit2/managed"
33
35
)
34
36
35
37
func TestCheckoutBranch_unmanaged (t * testing.T ) {
@@ -136,6 +138,11 @@ func checkoutBranch(t *testing.T, managed bool) {
136
138
for _ , tt := range tests {
137
139
t .Run (tt .name , func (t * testing.T ) {
138
140
g := NewWithT (t )
141
+ if ! managed {
142
+ g .Expect (mt .Enabled ()).To (BeFalse ())
143
+ } else {
144
+ g .Expect (mt .Enabled ()).To (BeTrue ())
145
+ }
139
146
140
147
branch := CheckoutBranch {
141
148
Branch : tt .branch ,
@@ -226,6 +233,11 @@ func checkoutTag(t *testing.T, managed bool) {
226
233
for _ , tt := range tests {
227
234
t .Run (tt .name , func (t * testing.T ) {
228
235
g := NewWithT (t )
236
+ if ! managed {
237
+ g .Expect (mt .Enabled ()).To (BeFalse ())
238
+ } else {
239
+ g .Expect (mt .Enabled ()).To (BeTrue ())
240
+ }
229
241
230
242
server , err := gittestserver .NewTempGitServer ()
231
243
g .Expect (err ).ToNot (HaveOccurred ())
@@ -315,6 +327,11 @@ func TestCheckoutCommit_unmanaged(t *testing.T) {
315
327
// via CheckoutCommit.
316
328
func checkoutCommit (t * testing.T , managed bool ) {
317
329
g := NewWithT (t )
330
+ if ! managed {
331
+ g .Expect (mt .Enabled ()).To (BeFalse ())
332
+ } else {
333
+ g .Expect (mt .Enabled ()).To (BeTrue ())
334
+ }
318
335
319
336
server , err := gittestserver .NewTempGitServer ()
320
337
if err != nil {
@@ -493,6 +510,11 @@ func checkoutSemVer(t *testing.T, managed bool) {
493
510
for _ , tt := range tests {
494
511
t .Run (tt .name , func (t * testing.T ) {
495
512
g := NewWithT (t )
513
+ if ! managed {
514
+ g .Expect (mt .Enabled ()).To (BeFalse ())
515
+ } else {
516
+ g .Expect (mt .Enabled ()).To (BeTrue ())
517
+ }
496
518
497
519
semVer := CheckoutSemVer {
498
520
SemVer : tt .constraint ,
@@ -611,6 +633,8 @@ func mockSignature(time time.Time) *git2go.Signature {
611
633
612
634
func TestInitializeRepoWithRemote (t * testing.T ) {
613
635
g := NewWithT (t )
636
+
637
+ g .Expect (mt .Enabled ()).To (BeFalse ())
614
638
tmp := t .TempDir ()
615
639
ctx := context .TODO ()
616
640
testRepoURL := "https://example.com/foo/bar"
0 commit comments