// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // 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. // The first argument is typically a *testing.T value. func NewMergeGit(t interface { mock.TestingT Cleanup(func()) }) *MergeGit { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &MergeGit{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // MergeGit is an autogenerated mock type for the MergeGit type type MergeGit struct { mock.Mock } type MergeGit_Expecter struct { mock *mock.Mock } func (_m *MergeGit) EXPECT() *MergeGit_Expecter { return &MergeGit_Expecter{mock: &_m.Mock} } // BranchHead provides a mock function for the type MergeGit func (_mock *MergeGit) BranchHead(ctx context.Context, repo domain.RepoName, branch string) (domain.ObjectID, error) { ret := _mock.Called(ctx, repo, branch) if len(ret) == 0 { panic("no return value specified for BranchHead") } var r0 domain.ObjectID var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) (domain.ObjectID, error)); ok { return returnFunc(ctx, repo, branch) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) domain.ObjectID); ok { r0 = returnFunc(ctx, repo, branch) } else { r0 = ret.Get(0).(domain.ObjectID) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, string) error); ok { r1 = returnFunc(ctx, repo, branch) } else { r1 = ret.Error(1) } return r0, r1 } // MergeGit_BranchHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BranchHead' type MergeGit_BranchHead_Call struct { *mock.Call } // BranchHead is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - branch string func (_e *MergeGit_Expecter) BranchHead(ctx any, repo any, branch any) *MergeGit_BranchHead_Call { return &MergeGit_BranchHead_Call{Call: _e.mock.On("BranchHead", ctx, repo, branch)} } func (_c *MergeGit_BranchHead_Call) Run(run func(ctx context.Context, repo domain.RepoName, branch string)) *MergeGit_BranchHead_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MergeGit_BranchHead_Call) Return(objectID domain.ObjectID, err error) *MergeGit_BranchHead_Call { _c.Call.Return(objectID, err) return _c } func (_c *MergeGit_BranchHead_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, branch string) (domain.ObjectID, error)) *MergeGit_BranchHead_Call { _c.Call.Return(run) return _c } // CommitTree provides a mock function for the type MergeGit func (_mock *MergeGit) CommitTree(ctx context.Context, repo domain.RepoName, id domain.ObjectID) (domain.ObjectID, error) { ret := _mock.Called(ctx, repo, id) if len(ret) == 0 { panic("no return value specified for CommitTree") } var r0 domain.ObjectID var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) (domain.ObjectID, error)); ok { return returnFunc(ctx, repo, id) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) domain.ObjectID); ok { r0 = returnFunc(ctx, repo, id) } else { r0 = ret.Get(0).(domain.ObjectID) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID) error); ok { r1 = returnFunc(ctx, repo, id) } else { r1 = ret.Error(1) } return r0, r1 } // MergeGit_CommitTree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CommitTree' type MergeGit_CommitTree_Call struct { *mock.Call } // CommitTree is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - id domain.ObjectID func (_e *MergeGit_Expecter) CommitTree(ctx any, repo any, id any) *MergeGit_CommitTree_Call { return &MergeGit_CommitTree_Call{Call: _e.mock.On("CommitTree", ctx, repo, id)} } func (_c *MergeGit_CommitTree_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.ObjectID)) *MergeGit_CommitTree_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 domain.ObjectID if args[2] != nil { arg2 = args[2].(domain.ObjectID) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MergeGit_CommitTree_Call) Return(objectID domain.ObjectID, err error) *MergeGit_CommitTree_Call { _c.Call.Return(objectID, err) return _c } func (_c *MergeGit_CommitTree_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.ObjectID) (domain.ObjectID, error)) *MergeGit_CommitTree_Call { _c.Call.Return(run) return _c } // DeleteBranch provides a mock function for the type MergeGit func (_mock *MergeGit) DeleteBranch(ctx context.Context, repo domain.RepoName, branch string, old domain.ObjectID) error { ret := _mock.Called(ctx, repo, branch, old) if len(ret) == 0 { panic("no return value specified for DeleteBranch") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string, domain.ObjectID) error); ok { r0 = returnFunc(ctx, repo, branch, old) } else { r0 = ret.Error(0) } return r0 } // MergeGit_DeleteBranch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBranch' type MergeGit_DeleteBranch_Call struct { *mock.Call } // DeleteBranch is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - branch string // - old domain.ObjectID func (_e *MergeGit_Expecter) DeleteBranch(ctx any, repo any, branch any, old any) *MergeGit_DeleteBranch_Call { return &MergeGit_DeleteBranch_Call{Call: _e.mock.On("DeleteBranch", ctx, repo, branch, old)} } func (_c *MergeGit_DeleteBranch_Call) Run(run func(ctx context.Context, repo domain.RepoName, branch string, old domain.ObjectID)) *MergeGit_DeleteBranch_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } var arg3 domain.ObjectID if args[3] != nil { arg3 = args[3].(domain.ObjectID) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MergeGit_DeleteBranch_Call) Return(err error) *MergeGit_DeleteBranch_Call { _c.Call.Return(err) return _c } func (_c *MergeGit_DeleteBranch_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, branch string, old domain.ObjectID) error) *MergeGit_DeleteBranch_Call { _c.Call.Return(run) return _c } // DiffCommits provides a mock function for the type MergeGit func (_mock *MergeGit) DiffCommits(ctx context.Context, repo domain.RepoName, base domain.ObjectID, head domain.ObjectID, limits domain.DiffLimits) (domain.DiffStats, domain.Diff, error) { ret := _mock.Called(ctx, repo, base, head, limits) if len(ret) == 0 { panic("no return value specified for DiffCommits") } var r0 domain.DiffStats var r1 domain.Diff var r2 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, domain.DiffLimits) (domain.DiffStats, domain.Diff, error)); ok { return returnFunc(ctx, repo, base, head, limits) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, domain.DiffLimits) domain.DiffStats); ok { r0 = returnFunc(ctx, repo, base, head, limits) } else { r0 = ret.Get(0).(domain.DiffStats) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, domain.DiffLimits) domain.Diff); ok { r1 = returnFunc(ctx, repo, base, head, limits) } else { r1 = ret.Get(1).(domain.Diff) } if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, domain.DiffLimits) error); ok { r2 = returnFunc(ctx, repo, base, head, limits) } else { r2 = ret.Error(2) } return r0, r1, r2 } // MergeGit_DiffCommits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DiffCommits' type MergeGit_DiffCommits_Call struct { *mock.Call } // DiffCommits is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - base domain.ObjectID // - head domain.ObjectID // - limits domain.DiffLimits func (_e *MergeGit_Expecter) DiffCommits(ctx any, repo any, base any, head any, limits any) *MergeGit_DiffCommits_Call { return &MergeGit_DiffCommits_Call{Call: _e.mock.On("DiffCommits", ctx, repo, base, head, limits)} } func (_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 { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 domain.ObjectID if args[2] != nil { arg2 = args[2].(domain.ObjectID) } var arg3 domain.ObjectID if args[3] != nil { arg3 = args[3].(domain.ObjectID) } var arg4 domain.DiffLimits if args[4] != nil { arg4 = args[4].(domain.DiffLimits) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *MergeGit_DiffCommits_Call) Return(diffStats domain.DiffStats, diff domain.Diff, err error) *MergeGit_DiffCommits_Call { _c.Call.Return(diffStats, diff, err) return _c } func (_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 { _c.Call.Return(run) return _c } // HasCommit provides a mock function for the type MergeGit func (_mock *MergeGit) HasCommit(ctx context.Context, repo domain.RepoName, id domain.ObjectID) (bool, error) { ret := _mock.Called(ctx, repo, id) if len(ret) == 0 { panic("no return value specified for HasCommit") } var r0 bool var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) (bool, error)); ok { return returnFunc(ctx, repo, id) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) bool); ok { r0 = returnFunc(ctx, repo, id) } else { r0 = ret.Get(0).(bool) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID) error); ok { r1 = returnFunc(ctx, repo, id) } else { r1 = ret.Error(1) } return r0, r1 } // MergeGit_HasCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasCommit' type MergeGit_HasCommit_Call struct { *mock.Call } // HasCommit is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - id domain.ObjectID func (_e *MergeGit_Expecter) HasCommit(ctx any, repo any, id any) *MergeGit_HasCommit_Call { return &MergeGit_HasCommit_Call{Call: _e.mock.On("HasCommit", ctx, repo, id)} } func (_c *MergeGit_HasCommit_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.ObjectID)) *MergeGit_HasCommit_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 domain.ObjectID if args[2] != nil { arg2 = args[2].(domain.ObjectID) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MergeGit_HasCommit_Call) Return(b bool, err error) *MergeGit_HasCommit_Call { _c.Call.Return(b, err) return _c } func (_c *MergeGit_HasCommit_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.ObjectID) (bool, error)) *MergeGit_HasCommit_Call { _c.Call.Return(run) return _c } // IsAncestor provides a mock function for the type MergeGit func (_mock *MergeGit) IsAncestor(ctx context.Context, repo domain.RepoName, ancestor domain.ObjectID, descendant domain.ObjectID) (bool, error) { ret := _mock.Called(ctx, repo, ancestor, descendant) if len(ret) == 0 { panic("no return value specified for IsAncestor") } var r0 bool var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) (bool, error)); ok { return returnFunc(ctx, repo, ancestor, descendant) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) bool); ok { r0 = returnFunc(ctx, repo, ancestor, descendant) } else { r0 = ret.Get(0).(bool) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok { r1 = returnFunc(ctx, repo, ancestor, descendant) } else { r1 = ret.Error(1) } return r0, r1 } // MergeGit_IsAncestor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAncestor' type MergeGit_IsAncestor_Call struct { *mock.Call } // IsAncestor is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - ancestor domain.ObjectID // - descendant domain.ObjectID func (_e *MergeGit_Expecter) IsAncestor(ctx any, repo any, ancestor any, descendant any) *MergeGit_IsAncestor_Call { return &MergeGit_IsAncestor_Call{Call: _e.mock.On("IsAncestor", ctx, repo, ancestor, descendant)} } func (_c *MergeGit_IsAncestor_Call) Run(run func(ctx context.Context, repo domain.RepoName, ancestor domain.ObjectID, descendant domain.ObjectID)) *MergeGit_IsAncestor_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 domain.ObjectID if args[2] != nil { arg2 = args[2].(domain.ObjectID) } var arg3 domain.ObjectID if args[3] != nil { arg3 = args[3].(domain.ObjectID) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MergeGit_IsAncestor_Call) Return(b bool, err error) *MergeGit_IsAncestor_Call { _c.Call.Return(b, err) return _c } func (_c *MergeGit_IsAncestor_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, ancestor domain.ObjectID, descendant domain.ObjectID) (bool, error)) *MergeGit_IsAncestor_Call { _c.Call.Return(run) return _c } // ListRange provides a mock function for the type MergeGit func (_mock *MergeGit) ListRange(ctx context.Context, repo domain.RepoName, exclude domain.ObjectID, head domain.ObjectID, limit int) ([]domain.Commit, bool, error) { ret := _mock.Called(ctx, repo, exclude, head, limit) if len(ret) == 0 { panic("no return value specified for ListRange") } var r0 []domain.Commit var r1 bool var r2 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, int) ([]domain.Commit, bool, error)); ok { return returnFunc(ctx, repo, exclude, head, limit) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, int) []domain.Commit); ok { r0 = returnFunc(ctx, repo, exclude, head, limit) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.Commit) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, int) bool); ok { r1 = returnFunc(ctx, repo, exclude, head, limit) } else { r1 = ret.Get(1).(bool) } if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID, int) error); ok { r2 = returnFunc(ctx, repo, exclude, head, limit) } else { r2 = ret.Error(2) } return r0, r1, r2 } // MergeGit_ListRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRange' type MergeGit_ListRange_Call struct { *mock.Call } // ListRange is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - exclude domain.ObjectID // - head domain.ObjectID // - limit int func (_e *MergeGit_Expecter) ListRange(ctx any, repo any, exclude any, head any, limit any) *MergeGit_ListRange_Call { return &MergeGit_ListRange_Call{Call: _e.mock.On("ListRange", ctx, repo, exclude, head, limit)} } func (_c *MergeGit_ListRange_Call) Run(run func(ctx context.Context, repo domain.RepoName, exclude domain.ObjectID, head domain.ObjectID, limit int)) *MergeGit_ListRange_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 domain.ObjectID if args[2] != nil { arg2 = args[2].(domain.ObjectID) } var arg3 domain.ObjectID if args[3] != nil { arg3 = args[3].(domain.ObjectID) } var arg4 int if args[4] != nil { arg4 = args[4].(int) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *MergeGit_ListRange_Call) Return(commits []domain.Commit, more bool, err error) *MergeGit_ListRange_Call { _c.Call.Return(commits, more, err) return _c } func (_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 { _c.Call.Return(run) return _c } // MergeBase provides a mock function for the type MergeGit func (_mock *MergeGit) MergeBase(ctx context.Context, repo domain.RepoName, a domain.ObjectID, b domain.ObjectID) (domain.ObjectID, error) { ret := _mock.Called(ctx, repo, a, b) if len(ret) == 0 { panic("no return value specified for MergeBase") } var r0 domain.ObjectID var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) (domain.ObjectID, error)); ok { return returnFunc(ctx, repo, a, b) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) domain.ObjectID); ok { r0 = returnFunc(ctx, repo, a, b) } else { r0 = ret.Get(0).(domain.ObjectID) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok { r1 = returnFunc(ctx, repo, a, b) } else { r1 = ret.Error(1) } return r0, r1 } // MergeGit_MergeBase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MergeBase' type MergeGit_MergeBase_Call struct { *mock.Call } // MergeBase is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - a domain.ObjectID // - b domain.ObjectID func (_e *MergeGit_Expecter) MergeBase(ctx any, repo any, a any, b any) *MergeGit_MergeBase_Call { return &MergeGit_MergeBase_Call{Call: _e.mock.On("MergeBase", ctx, repo, a, b)} } func (_c *MergeGit_MergeBase_Call) Run(run func(ctx context.Context, repo domain.RepoName, a domain.ObjectID, b domain.ObjectID)) *MergeGit_MergeBase_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 domain.ObjectID if args[2] != nil { arg2 = args[2].(domain.ObjectID) } var arg3 domain.ObjectID if args[3] != nil { arg3 = args[3].(domain.ObjectID) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MergeGit_MergeBase_Call) Return(objectID domain.ObjectID, err error) *MergeGit_MergeBase_Call { _c.Call.Return(objectID, err) return _c } func (_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 { _c.Call.Return(run) return _c } // UpdateBranch provides a mock function for the type MergeGit func (_mock *MergeGit) UpdateBranch(ctx context.Context, repo domain.RepoName, branch string, old domain.ObjectID, new domain.ObjectID) error { ret := _mock.Called(ctx, repo, branch, old, new) if len(ret) == 0 { panic("no return value specified for UpdateBranch") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string, domain.ObjectID, domain.ObjectID) error); ok { r0 = returnFunc(ctx, repo, branch, old, new) } else { r0 = ret.Error(0) } return r0 } // MergeGit_UpdateBranch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBranch' type MergeGit_UpdateBranch_Call struct { *mock.Call } // UpdateBranch is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - branch string // - old domain.ObjectID // - new domain.ObjectID func (_e *MergeGit_Expecter) UpdateBranch(ctx any, repo any, branch any, old any, new any) *MergeGit_UpdateBranch_Call { return &MergeGit_UpdateBranch_Call{Call: _e.mock.On("UpdateBranch", ctx, repo, branch, old, new)} } func (_c *MergeGit_UpdateBranch_Call) Run(run func(ctx context.Context, repo domain.RepoName, branch string, old domain.ObjectID, new domain.ObjectID)) *MergeGit_UpdateBranch_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } var arg3 domain.ObjectID if args[3] != nil { arg3 = args[3].(domain.ObjectID) } var arg4 domain.ObjectID if args[4] != nil { arg4 = args[4].(domain.ObjectID) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *MergeGit_UpdateBranch_Call) Return(err error) *MergeGit_UpdateBranch_Call { _c.Call.Return(err) return _c } func (_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 { _c.Call.Return(run) return _c } // WriteCommit provides a mock function for the type MergeGit func (_mock *MergeGit) WriteCommit(ctx context.Context, repo domain.RepoName, object []byte) (domain.ObjectID, error) { ret := _mock.Called(ctx, repo, object) if len(ret) == 0 { panic("no return value specified for WriteCommit") } var r0 domain.ObjectID var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []byte) (domain.ObjectID, error)); ok { return returnFunc(ctx, repo, object) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []byte) domain.ObjectID); ok { r0 = returnFunc(ctx, repo, object) } else { r0 = ret.Get(0).(domain.ObjectID) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, []byte) error); ok { r1 = returnFunc(ctx, repo, object) } else { r1 = ret.Error(1) } return r0, r1 } // MergeGit_WriteCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteCommit' type MergeGit_WriteCommit_Call struct { *mock.Call } // WriteCommit is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - object []byte func (_e *MergeGit_Expecter) WriteCommit(ctx any, repo any, object any) *MergeGit_WriteCommit_Call { return &MergeGit_WriteCommit_Call{Call: _e.mock.On("WriteCommit", ctx, repo, object)} } func (_c *MergeGit_WriteCommit_Call) Run(run func(ctx context.Context, repo domain.RepoName, object []byte)) *MergeGit_WriteCommit_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 []byte if args[2] != nil { arg2 = args[2].([]byte) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MergeGit_WriteCommit_Call) Return(objectID domain.ObjectID, err error) *MergeGit_WriteCommit_Call { _c.Call.Return(objectID, err) return _c } func (_c *MergeGit_WriteCommit_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, object []byte) (domain.ObjectID, error)) *MergeGit_WriteCommit_Call { _c.Call.Return(run) return _c }