@@ -102,7 +102,7 @@ func TestCheckoutBranch_ShouldFailOnGetSecret(t *testing.T) {
102102 mGit := gitServerMocks .NewMockGit (t )
103103 mGit .On ("GetCurrentBranchName" , testify .Anything , "project-path" ).Return ("some-other-branch" , nil )
104104
105- err := CheckoutBranch (context .Background (), "repo" , "project-path" , " branch" , mGit , c , fakeCl , func (config gitproviderv2.Config ) gitproviderv2.Git {
105+ err := CheckoutBranch (context .Background (), "branch" , & GitRepositoryContext {} , c , fakeCl , func (config gitproviderv2.Config ) gitproviderv2.Git {
106106 return mGit
107107 })
108108 assert .Error (t , err )
@@ -143,7 +143,7 @@ func TestCheckoutBranch_ShouldFailOnGetCurrentBranchName(t *testing.T) {
143143 mGit := gitServerMocks .NewMockGit (t )
144144 mGit .On ("GetCurrentBranchName" , testify .Anything , "project-path" ).Return ("" , errors .New ("FATAL:FAILED" ))
145145
146- err := CheckoutBranch (context .Background (), "repo" , "project-path" , " branch" , mGit , c , fakeCl , func (config gitproviderv2.Config ) gitproviderv2.Git {
146+ err := CheckoutBranch (context .Background (), "branch" , & GitRepositoryContext {} , c , fakeCl , func (config gitproviderv2.Config ) gitproviderv2.Git {
147147 return mGit
148148 })
149149 assert .Error (t , err )
@@ -154,7 +154,6 @@ func TestCheckoutBranch_ShouldFailOnGetCurrentBranchName(t *testing.T) {
154154}
155155
156156func TestCheckoutBranch_ShouldFailOnCheckout (t * testing.T ) {
157- repo := "repo"
158157 c := & codebaseApi.Codebase {
159158 ObjectMeta : metaV1.ObjectMeta {
160159 Name : "fake-name" ,
@@ -186,7 +185,7 @@ func TestCheckoutBranch_ShouldFailOnCheckout(t *testing.T) {
186185 mGit .On ("GetCurrentBranchName" , testify .Anything , "project-path" ).Return ("some-other-branch" , nil )
187186 mGit .On ("Checkout" , testify .Anything , "project-path" , "branch" , true ).Return (errors .New ("FATAL:FAILED" ))
188187
189- err := CheckoutBranch (context .Background (), repo , "project-path" , " branch" , mGit , c , fakeCl , func (config gitproviderv2.Config ) gitproviderv2.Git {
188+ err := CheckoutBranch (context .Background (), " branch" , & GitRepositoryContext {} , c , fakeCl , func (config gitproviderv2.Config ) gitproviderv2.Git {
190189 return mGit
191190 })
192191 assert .Error (t , err )
@@ -197,7 +196,6 @@ func TestCheckoutBranch_ShouldFailOnCheckout(t *testing.T) {
197196}
198197
199198func TestCheckoutBranch_ShouldPassForCloneStrategy (t * testing.T ) {
200- repo := "repo"
201199 c := & codebaseApi.Codebase {
202200 ObjectMeta : metaV1.ObjectMeta {
203201 Name : "fake-name" ,
@@ -251,7 +249,7 @@ func TestCheckoutBranch_ShouldPassForCloneStrategy(t *testing.T) {
251249 mGit .On ("GetCurrentBranchName" , testify .Anything , "project-path" ).Return ("some-other-branch" , nil )
252250 mGit .On ("CheckoutRemoteBranch" , testify .Anything , "project-path" , "branch" ).Return (nil )
253251
254- err := CheckoutBranch (context .Background (), repo , "project-path" , " branch" , mGit , c , fakeCl , func (config gitproviderv2.Config ) gitproviderv2.Git {
252+ err := CheckoutBranch (context .Background (), " branch" , & GitRepositoryContext {} , c , fakeCl , func (config gitproviderv2.Config ) gitproviderv2.Git {
255253 return mGit
256254 })
257255 assert .NoError (t , err )
0 commit comments