1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// NewMergeGit creates a new instance of MergeGit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewMergeGit(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *MergeGit {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &MergeGit{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// MergeGit is an autogenerated mock type for the MergeGit type
38type MergeGit struct {
39 mock.Mock
40}
41
42type MergeGit_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *MergeGit) EXPECT() *MergeGit_Expecter {
47 return &MergeGit_Expecter{mock: &_m.Mock}
48}
49
50// BranchHead provides a mock function for the type MergeGit
51func (_mock *MergeGit) BranchHead(ctx context.Context, repo domain.RepoName, branch string) (domain.ObjectID, error) {
52 ret := _mock.Called(ctx, repo, branch)
53
54 if len(ret) == 0 {
55 panic("no return value specified for BranchHead")
56 }
57
58 var r0 domain.ObjectID
59 var r1 error
60 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) (domain.ObjectID, error)); ok {
61 return returnFunc(ctx, repo, branch)
62 }
63 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) domain.ObjectID); ok {
64 r0 = returnFunc(ctx, repo, branch)
65 } else {
66 r0 = ret.Get(0).(domain.ObjectID)
67 }
68 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, string) error); ok {
69 r1 = returnFunc(ctx, repo, branch)
70 } else {
71 r1 = ret.Error(1)
72 }
73 return r0, r1
74}
75
76// MergeGit_BranchHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BranchHead'
77type MergeGit_BranchHead_Call struct {
78 *mock.Call
79}
80
81// BranchHead is a helper method to define mock.On call
82// - ctx context.Context
83// - repo domain.RepoName
84// - branch string
85func (_e *MergeGit_Expecter) BranchHead(ctx any, repo any, branch any) *MergeGit_BranchHead_Call {
86 return &MergeGit_BranchHead_Call{Call: _e.mock.On("BranchHead", ctx, repo, branch)}
87}
88
89func (_c *MergeGit_BranchHead_Call) Run(run func(ctx context.Context, repo domain.RepoName, branch string)) *MergeGit_BranchHead_Call {
90 _c.Call.Run(func(args mock.Arguments) {
91 var arg0 context.Context
92 if args[0] != nil {
93 arg0 = args[0].(context.Context)
94 }
95 var arg1 domain.RepoName
96 if args[1] != nil {
97 arg1 = args[1].(domain.RepoName)
98 }
99 var arg2 string
100 if args[2] != nil {
101 arg2 = args[2].(string)
102 }
103 run(
104 arg0,
105 arg1,
106 arg2,
107 )
108 })
109 return _c
110}
111
112func (_c *MergeGit_BranchHead_Call) Return(objectID domain.ObjectID, err error) *MergeGit_BranchHead_Call {
113 _c.Call.Return(objectID, err)
114 return _c
115}
116
117func (_c *MergeGit_BranchHead_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, branch string) (domain.ObjectID, error)) *MergeGit_BranchHead_Call {
118 _c.Call.Return(run)
119 return _c
120}
121
122// CommitTree provides a mock function for the type MergeGit
123func (_mock *MergeGit) CommitTree(ctx context.Context, repo domain.RepoName, id domain.ObjectID) (domain.ObjectID, error) {
124 ret := _mock.Called(ctx, repo, id)
125
126 if len(ret) == 0 {
127 panic("no return value specified for CommitTree")
128 }
129
130 var r0 domain.ObjectID
131 var r1 error
132 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) (domain.ObjectID, error)); ok {
133 return returnFunc(ctx, repo, id)
134 }
135 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) domain.ObjectID); ok {
136 r0 = returnFunc(ctx, repo, id)
137 } else {
138 r0 = ret.Get(0).(domain.ObjectID)
139 }
140 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID) error); ok {
141 r1 = returnFunc(ctx, repo, id)
142 } else {
143 r1 = ret.Error(1)
144 }
145 return r0, r1
146}
147
148// MergeGit_CommitTree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CommitTree'
149type MergeGit_CommitTree_Call struct {
150 *mock.Call
151}
152
153// CommitTree is a helper method to define mock.On call
154// - ctx context.Context
155// - repo domain.RepoName
156// - id domain.ObjectID
157func (_e *MergeGit_Expecter) CommitTree(ctx any, repo any, id any) *MergeGit_CommitTree_Call {
158 return &MergeGit_CommitTree_Call{Call: _e.mock.On("CommitTree", ctx, repo, id)}
159}
160
161func (_c *MergeGit_CommitTree_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.ObjectID)) *MergeGit_CommitTree_Call {
162 _c.Call.Run(func(args mock.Arguments) {
163 var arg0 context.Context
164 if args[0] != nil {
165 arg0 = args[0].(context.Context)
166 }
167 var arg1 domain.RepoName
168 if args[1] != nil {
169 arg1 = args[1].(domain.RepoName)
170 }
171 var arg2 domain.ObjectID
172 if args[2] != nil {
173 arg2 = args[2].(domain.ObjectID)
174 }
175 run(
176 arg0,
177 arg1,
178 arg2,
179 )
180 })
181 return _c
182}
183
184func (_c *MergeGit_CommitTree_Call) Return(objectID domain.ObjectID, err error) *MergeGit_CommitTree_Call {
185 _c.Call.Return(objectID, err)
186 return _c
187}
188
189func (_c *MergeGit_CommitTree_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.ObjectID) (domain.ObjectID, error)) *MergeGit_CommitTree_Call {
190 _c.Call.Return(run)
191 return _c
192}
193
194// DiffCommits provides a mock function for the type MergeGit
195func (_mock *MergeGit) DiffCommits(ctx context.Context, repo domain.RepoName, base domain.ObjectID, head domain.ObjectID, limits domain.DiffLimits) (domain.DiffStats, domain.Diff, error) {
196 ret := _mock.Called(ctx, repo, base, head, limits)
197
198 if len(ret) == 0 {
199 panic("no return value specified for DiffCommits")
200 }
201
202 var r0 domain.DiffStats
203 var r1 domain.Diff
204 var r2 error
205 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, domain.DiffLimits) (domain.DiffStats, domain.Diff, error)); ok {
206 return returnFunc(ctx, repo, base, head, limits)
207 }
208 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, domain.DiffLimits) domain.DiffStats); ok {
209 r0 = returnFunc(ctx, repo, base, head, limits)
210 } else {
211 r0 = ret.Get(0).(domain.DiffStats)
212 }
213 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, domain.DiffLimits) domain.Diff); ok {
214 r1 = returnFunc(ctx, repo, base, head, limits)
215 } else {
216 r1 = ret.Get(1).(domain.Diff)
217 }
218 if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, domain.DiffLimits) error); ok {
219 r2 = returnFunc(ctx, repo, base, head, limits)
220 } else {
221 r2 = ret.Error(2)
222 }
223 return r0, r1, r2
224}
225
226// MergeGit_DiffCommits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DiffCommits'
227type MergeGit_DiffCommits_Call struct {
228 *mock.Call
229}
230
231// DiffCommits is a helper method to define mock.On call
232// - ctx context.Context
233// - repo domain.RepoName
234// - base domain.ObjectID
235// - head domain.ObjectID
236// - limits domain.DiffLimits
237func (_e *MergeGit_Expecter) DiffCommits(ctx any, repo any, base any, head any, limits any) *MergeGit_DiffCommits_Call {
238 return &MergeGit_DiffCommits_Call{Call: _e.mock.On("DiffCommits", ctx, repo, base, head, limits)}
239}
240
241func (_c *MergeGit_DiffCommits_Call) Run(run func(ctx context.Context, repo domain.RepoName, base domain.ObjectID, head domain.ObjectID, limits domain.DiffLimits)) *MergeGit_DiffCommits_Call {
242 _c.Call.Run(func(args mock.Arguments) {
243 var arg0 context.Context
244 if args[0] != nil {
245 arg0 = args[0].(context.Context)
246 }
247 var arg1 domain.RepoName
248 if args[1] != nil {
249 arg1 = args[1].(domain.RepoName)
250 }
251 var arg2 domain.ObjectID
252 if args[2] != nil {
253 arg2 = args[2].(domain.ObjectID)
254 }
255 var arg3 domain.ObjectID
256 if args[3] != nil {
257 arg3 = args[3].(domain.ObjectID)
258 }
259 var arg4 domain.DiffLimits
260 if args[4] != nil {
261 arg4 = args[4].(domain.DiffLimits)
262 }
263 run(
264 arg0,
265 arg1,
266 arg2,
267 arg3,
268 arg4,
269 )
270 })
271 return _c
272}
273
274func (_c *MergeGit_DiffCommits_Call) Return(diffStats domain.DiffStats, diff domain.Diff, err error) *MergeGit_DiffCommits_Call {
275 _c.Call.Return(diffStats, diff, err)
276 return _c
277}
278
279func (_c *MergeGit_DiffCommits_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, base domain.ObjectID, head domain.ObjectID, limits domain.DiffLimits) (domain.DiffStats, domain.Diff, error)) *MergeGit_DiffCommits_Call {
280 _c.Call.Return(run)
281 return _c
282}
283
284// HasCommit provides a mock function for the type MergeGit
285func (_mock *MergeGit) HasCommit(ctx context.Context, repo domain.RepoName, id domain.ObjectID) (bool, error) {
286 ret := _mock.Called(ctx, repo, id)
287
288 if len(ret) == 0 {
289 panic("no return value specified for HasCommit")
290 }
291
292 var r0 bool
293 var r1 error
294 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) (bool, error)); ok {
295 return returnFunc(ctx, repo, id)
296 }
297 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) bool); ok {
298 r0 = returnFunc(ctx, repo, id)
299 } else {
300 r0 = ret.Get(0).(bool)
301 }
302 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID) error); ok {
303 r1 = returnFunc(ctx, repo, id)
304 } else {
305 r1 = ret.Error(1)
306 }
307 return r0, r1
308}
309
310// MergeGit_HasCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasCommit'
311type MergeGit_HasCommit_Call struct {
312 *mock.Call
313}
314
315// HasCommit is a helper method to define mock.On call
316// - ctx context.Context
317// - repo domain.RepoName
318// - id domain.ObjectID
319func (_e *MergeGit_Expecter) HasCommit(ctx any, repo any, id any) *MergeGit_HasCommit_Call {
320 return &MergeGit_HasCommit_Call{Call: _e.mock.On("HasCommit", ctx, repo, id)}
321}
322
323func (_c *MergeGit_HasCommit_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.ObjectID)) *MergeGit_HasCommit_Call {
324 _c.Call.Run(func(args mock.Arguments) {
325 var arg0 context.Context
326 if args[0] != nil {
327 arg0 = args[0].(context.Context)
328 }
329 var arg1 domain.RepoName
330 if args[1] != nil {
331 arg1 = args[1].(domain.RepoName)
332 }
333 var arg2 domain.ObjectID
334 if args[2] != nil {
335 arg2 = args[2].(domain.ObjectID)
336 }
337 run(
338 arg0,
339 arg1,
340 arg2,
341 )
342 })
343 return _c
344}
345
346func (_c *MergeGit_HasCommit_Call) Return(b bool, err error) *MergeGit_HasCommit_Call {
347 _c.Call.Return(b, err)
348 return _c
349}
350
351func (_c *MergeGit_HasCommit_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.ObjectID) (bool, error)) *MergeGit_HasCommit_Call {
352 _c.Call.Return(run)
353 return _c
354}
355
356// IsAncestor provides a mock function for the type MergeGit
357func (_mock *MergeGit) IsAncestor(ctx context.Context, repo domain.RepoName, ancestor domain.ObjectID, descendant domain.ObjectID) (bool, error) {
358 ret := _mock.Called(ctx, repo, ancestor, descendant)
359
360 if len(ret) == 0 {
361 panic("no return value specified for IsAncestor")
362 }
363
364 var r0 bool
365 var r1 error
366 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) (bool, error)); ok {
367 return returnFunc(ctx, repo, ancestor, descendant)
368 }
369 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) bool); ok {
370 r0 = returnFunc(ctx, repo, ancestor, descendant)
371 } else {
372 r0 = ret.Get(0).(bool)
373 }
374 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok {
375 r1 = returnFunc(ctx, repo, ancestor, descendant)
376 } else {
377 r1 = ret.Error(1)
378 }
379 return r0, r1
380}
381
382// MergeGit_IsAncestor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAncestor'
383type MergeGit_IsAncestor_Call struct {
384 *mock.Call
385}
386
387// IsAncestor is a helper method to define mock.On call
388// - ctx context.Context
389// - repo domain.RepoName
390// - ancestor domain.ObjectID
391// - descendant domain.ObjectID
392func (_e *MergeGit_Expecter) IsAncestor(ctx any, repo any, ancestor any, descendant any) *MergeGit_IsAncestor_Call {
393 return &MergeGit_IsAncestor_Call{Call: _e.mock.On("IsAncestor", ctx, repo, ancestor, descendant)}
394}
395
396func (_c *MergeGit_IsAncestor_Call) Run(run func(ctx context.Context, repo domain.RepoName, ancestor domain.ObjectID, descendant domain.ObjectID)) *MergeGit_IsAncestor_Call {
397 _c.Call.Run(func(args mock.Arguments) {
398 var arg0 context.Context
399 if args[0] != nil {
400 arg0 = args[0].(context.Context)
401 }
402 var arg1 domain.RepoName
403 if args[1] != nil {
404 arg1 = args[1].(domain.RepoName)
405 }
406 var arg2 domain.ObjectID
407 if args[2] != nil {
408 arg2 = args[2].(domain.ObjectID)
409 }
410 var arg3 domain.ObjectID
411 if args[3] != nil {
412 arg3 = args[3].(domain.ObjectID)
413 }
414 run(
415 arg0,
416 arg1,
417 arg2,
418 arg3,
419 )
420 })
421 return _c
422}
423
424func (_c *MergeGit_IsAncestor_Call) Return(b bool, err error) *MergeGit_IsAncestor_Call {
425 _c.Call.Return(b, err)
426 return _c
427}
428
429func (_c *MergeGit_IsAncestor_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, ancestor domain.ObjectID, descendant domain.ObjectID) (bool, error)) *MergeGit_IsAncestor_Call {
430 _c.Call.Return(run)
431 return _c
432}
433
434// ListRange provides a mock function for the type MergeGit
435func (_mock *MergeGit) ListRange(ctx context.Context, repo domain.RepoName, exclude domain.ObjectID, head domain.ObjectID, limit int) ([]domain.Commit, bool, error) {
436 ret := _mock.Called(ctx, repo, exclude, head, limit)
437
438 if len(ret) == 0 {
439 panic("no return value specified for ListRange")
440 }
441
442 var r0 []domain.Commit
443 var r1 bool
444 var r2 error
445 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, int) ([]domain.Commit, bool, error)); ok {
446 return returnFunc(ctx, repo, exclude, head, limit)
447 }
448 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, int) []domain.Commit); ok {
449 r0 = returnFunc(ctx, repo, exclude, head, limit)
450 } else {
451 if ret.Get(0) != nil {
452 r0 = ret.Get(0).([]domain.Commit)
453 }
454 }
455 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, int) bool); ok {
456 r1 = returnFunc(ctx, repo, exclude, head, limit)
457 } else {
458 r1 = ret.Get(1).(bool)
459 }
460 if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, int) error); ok {
461 r2 = returnFunc(ctx, repo, exclude, head, limit)
462 } else {
463 r2 = ret.Error(2)
464 }
465 return r0, r1, r2
466}
467
468// MergeGit_ListRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRange'
469type MergeGit_ListRange_Call struct {
470 *mock.Call
471}
472
473// ListRange is a helper method to define mock.On call
474// - ctx context.Context
475// - repo domain.RepoName
476// - exclude domain.ObjectID
477// - head domain.ObjectID
478// - limit int
479func (_e *MergeGit_Expecter) ListRange(ctx any, repo any, exclude any, head any, limit any) *MergeGit_ListRange_Call {
480 return &MergeGit_ListRange_Call{Call: _e.mock.On("ListRange", ctx, repo, exclude, head, limit)}
481}
482
483func (_c *MergeGit_ListRange_Call) Run(run func(ctx context.Context, repo domain.RepoName, exclude domain.ObjectID, head domain.ObjectID, limit int)) *MergeGit_ListRange_Call {
484 _c.Call.Run(func(args mock.Arguments) {
485 var arg0 context.Context
486 if args[0] != nil {
487 arg0 = args[0].(context.Context)
488 }
489 var arg1 domain.RepoName
490 if args[1] != nil {
491 arg1 = args[1].(domain.RepoName)
492 }
493 var arg2 domain.ObjectID
494 if args[2] != nil {
495 arg2 = args[2].(domain.ObjectID)
496 }
497 var arg3 domain.ObjectID
498 if args[3] != nil {
499 arg3 = args[3].(domain.ObjectID)
500 }
501 var arg4 int
502 if args[4] != nil {
503 arg4 = args[4].(int)
504 }
505 run(
506 arg0,
507 arg1,
508 arg2,
509 arg3,
510 arg4,
511 )
512 })
513 return _c
514}
515
516func (_c *MergeGit_ListRange_Call) Return(commits []domain.Commit, more bool, err error) *MergeGit_ListRange_Call {
517 _c.Call.Return(commits, more, err)
518 return _c
519}
520
521func (_c *MergeGit_ListRange_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, exclude domain.ObjectID, head domain.ObjectID, limit int) ([]domain.Commit, bool, error)) *MergeGit_ListRange_Call {
522 _c.Call.Return(run)
523 return _c
524}
525
526// MergeBase provides a mock function for the type MergeGit
527func (_mock *MergeGit) MergeBase(ctx context.Context, repo domain.RepoName, a domain.ObjectID, b domain.ObjectID) (domain.ObjectID, error) {
528 ret := _mock.Called(ctx, repo, a, b)
529
530 if len(ret) == 0 {
531 panic("no return value specified for MergeBase")
532 }
533
534 var r0 domain.ObjectID
535 var r1 error
536 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) (domain.ObjectID, error)); ok {
537 return returnFunc(ctx, repo, a, b)
538 }
539 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) domain.ObjectID); ok {
540 r0 = returnFunc(ctx, repo, a, b)
541 } else {
542 r0 = ret.Get(0).(domain.ObjectID)
543 }
544 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok {
545 r1 = returnFunc(ctx, repo, a, b)
546 } else {
547 r1 = ret.Error(1)
548 }
549 return r0, r1
550}
551
552// MergeGit_MergeBase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MergeBase'
553type MergeGit_MergeBase_Call struct {
554 *mock.Call
555}
556
557// MergeBase is a helper method to define mock.On call
558// - ctx context.Context
559// - repo domain.RepoName
560// - a domain.ObjectID
561// - b domain.ObjectID
562func (_e *MergeGit_Expecter) MergeBase(ctx any, repo any, a any, b any) *MergeGit_MergeBase_Call {
563 return &MergeGit_MergeBase_Call{Call: _e.mock.On("MergeBase", ctx, repo, a, b)}
564}
565
566func (_c *MergeGit_MergeBase_Call) Run(run func(ctx context.Context, repo domain.RepoName, a domain.ObjectID, b domain.ObjectID)) *MergeGit_MergeBase_Call {
567 _c.Call.Run(func(args mock.Arguments) {
568 var arg0 context.Context
569 if args[0] != nil {
570 arg0 = args[0].(context.Context)
571 }
572 var arg1 domain.RepoName
573 if args[1] != nil {
574 arg1 = args[1].(domain.RepoName)
575 }
576 var arg2 domain.ObjectID
577 if args[2] != nil {
578 arg2 = args[2].(domain.ObjectID)
579 }
580 var arg3 domain.ObjectID
581 if args[3] != nil {
582 arg3 = args[3].(domain.ObjectID)
583 }
584 run(
585 arg0,
586 arg1,
587 arg2,
588 arg3,
589 )
590 })
591 return _c
592}
593
594func (_c *MergeGit_MergeBase_Call) Return(objectID domain.ObjectID, err error) *MergeGit_MergeBase_Call {
595 _c.Call.Return(objectID, err)
596 return _c
597}
598
599func (_c *MergeGit_MergeBase_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, a domain.ObjectID, b domain.ObjectID) (domain.ObjectID, error)) *MergeGit_MergeBase_Call {
600 _c.Call.Return(run)
601 return _c
602}
603
604// UpdateBranch provides a mock function for the type MergeGit
605func (_mock *MergeGit) UpdateBranch(ctx context.Context, repo domain.RepoName, branch string, old domain.ObjectID, new domain.ObjectID) error {
606 ret := _mock.Called(ctx, repo, branch, old, new)
607
608 if len(ret) == 0 {
609 panic("no return value specified for UpdateBranch")
610 }
611
612 var r0 error
613 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string, domain.ObjectID, domain.ObjectID) error); ok {
614 r0 = returnFunc(ctx, repo, branch, old, new)
615 } else {
616 r0 = ret.Error(0)
617 }
618 return r0
619}
620
621// MergeGit_UpdateBranch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBranch'
622type MergeGit_UpdateBranch_Call struct {
623 *mock.Call
624}
625
626// UpdateBranch is a helper method to define mock.On call
627// - ctx context.Context
628// - repo domain.RepoName
629// - branch string
630// - old domain.ObjectID
631// - new domain.ObjectID
632func (_e *MergeGit_Expecter) UpdateBranch(ctx any, repo any, branch any, old any, new any) *MergeGit_UpdateBranch_Call {
633 return &MergeGit_UpdateBranch_Call{Call: _e.mock.On("UpdateBranch", ctx, repo, branch, old, new)}
634}
635
636func (_c *MergeGit_UpdateBranch_Call) Run(run func(ctx context.Context, repo domain.RepoName, branch string, old domain.ObjectID, new domain.ObjectID)) *MergeGit_UpdateBranch_Call {
637 _c.Call.Run(func(args mock.Arguments) {
638 var arg0 context.Context
639 if args[0] != nil {
640 arg0 = args[0].(context.Context)
641 }
642 var arg1 domain.RepoName
643 if args[1] != nil {
644 arg1 = args[1].(domain.RepoName)
645 }
646 var arg2 string
647 if args[2] != nil {
648 arg2 = args[2].(string)
649 }
650 var arg3 domain.ObjectID
651 if args[3] != nil {
652 arg3 = args[3].(domain.ObjectID)
653 }
654 var arg4 domain.ObjectID
655 if args[4] != nil {
656 arg4 = args[4].(domain.ObjectID)
657 }
658 run(
659 arg0,
660 arg1,
661 arg2,
662 arg3,
663 arg4,
664 )
665 })
666 return _c
667}
668
669func (_c *MergeGit_UpdateBranch_Call) Return(err error) *MergeGit_UpdateBranch_Call {
670 _c.Call.Return(err)
671 return _c
672}
673
674func (_c *MergeGit_UpdateBranch_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, branch string, old domain.ObjectID, new domain.ObjectID) error) *MergeGit_UpdateBranch_Call {
675 _c.Call.Return(run)
676 return _c
677}
678
679// WriteCommit provides a mock function for the type MergeGit
680func (_mock *MergeGit) WriteCommit(ctx context.Context, repo domain.RepoName, object []byte) (domain.ObjectID, error) {
681 ret := _mock.Called(ctx, repo, object)
682
683 if len(ret) == 0 {
684 panic("no return value specified for WriteCommit")
685 }
686
687 var r0 domain.ObjectID
688 var r1 error
689 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []byte) (domain.ObjectID, error)); ok {
690 return returnFunc(ctx, repo, object)
691 }
692 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []byte) domain.ObjectID); ok {
693 r0 = returnFunc(ctx, repo, object)
694 } else {
695 r0 = ret.Get(0).(domain.ObjectID)
696 }
697 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, []byte) error); ok {
698 r1 = returnFunc(ctx, repo, object)
699 } else {
700 r1 = ret.Error(1)
701 }
702 return r0, r1
703}
704
705// MergeGit_WriteCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteCommit'
706type MergeGit_WriteCommit_Call struct {
707 *mock.Call
708}
709
710// WriteCommit is a helper method to define mock.On call
711// - ctx context.Context
712// - repo domain.RepoName
713// - object []byte
714func (_e *MergeGit_Expecter) WriteCommit(ctx any, repo any, object any) *MergeGit_WriteCommit_Call {
715 return &MergeGit_WriteCommit_Call{Call: _e.mock.On("WriteCommit", ctx, repo, object)}
716}
717
718func (_c *MergeGit_WriteCommit_Call) Run(run func(ctx context.Context, repo domain.RepoName, object []byte)) *MergeGit_WriteCommit_Call {
719 _c.Call.Run(func(args mock.Arguments) {
720 var arg0 context.Context
721 if args[0] != nil {
722 arg0 = args[0].(context.Context)
723 }
724 var arg1 domain.RepoName
725 if args[1] != nil {
726 arg1 = args[1].(domain.RepoName)
727 }
728 var arg2 []byte
729 if args[2] != nil {
730 arg2 = args[2].([]byte)
731 }
732 run(
733 arg0,
734 arg1,
735 arg2,
736 )
737 })
738 return _c
739}
740
741func (_c *MergeGit_WriteCommit_Call) Return(objectID domain.ObjectID, err error) *MergeGit_WriteCommit_Call {
742 _c.Call.Return(objectID, err)
743 return _c
744}
745
746func (_c *MergeGit_WriteCommit_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, object []byte) (domain.ObjectID, error)) *MergeGit_WriteCommit_Call {
747 _c.Call.Return(run)
748 return _c
749}