detached 98d36bf

RepoReader.go RawHistoryFolder

1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8	"context"
9	"io"
10	"time"
11
12	"bnema.dev/ermite/internal/domain"
13	"bnema.dev/ermite/internal/ports"
14	mock "github.com/stretchr/testify/mock"
15)
16
17// NewRepoReader creates a new instance of RepoReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
18// The first argument is typically a *testing.T value.
19func NewRepoReader(t interface {
20	mock.TestingT
21	Cleanup(func())
22}) *RepoReader {
23	if helper, ok := t.(interface{ Helper() }); ok {
24		helper.Helper()
25	}
26
27	mock := &RepoReader{}
28	mock.Mock.Test(t)
29
30	t.Cleanup(func() {
31		if helper, ok := t.(interface{ Helper() }); ok {
32			helper.Helper()
33		}
34		mock.AssertExpectations(t)
35	})
36
37	return mock
38}
39
40// RepoReader is an autogenerated mock type for the RepoReader type
41type RepoReader struct {
42	mock.Mock
43}
44
45type RepoReader_Expecter struct {
46	mock *mock.Mock
47}
48
49func (_m *RepoReader) EXPECT() *RepoReader_Expecter {
50	return &RepoReader_Expecter{mock: &_m.Mock}
51}
52
53// CommitTimes provides a mock function for the type RepoReader
54func (_mock *RepoReader) CommitTimes(ctx context.Context, repo domain.RepoName, head domain.ObjectID, since time.Time) ([]time.Time, bool, error) {
55	ret := _mock.Called(ctx, repo, head, since)
56
57	if len(ret) == 0 {
58		panic("no return value specified for CommitTimes")
59	}
60
61	var r0 []time.Time
62	var r1 bool
63	var r2 error
64	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, time.Time) ([]time.Time, bool, error)); ok {
65		return returnFunc(ctx, repo, head, since)
66	}
67	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, time.Time) []time.Time); ok {
68		r0 = returnFunc(ctx, repo, head, since)
69	} else {
70		if ret.Get(0) != nil {
71			r0 = ret.Get(0).([]time.Time)
72		}
73	}
74	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, time.Time) bool); ok {
75		r1 = returnFunc(ctx, repo, head, since)
76	} else {
77		r1 = ret.Get(1).(bool)
78	}
79	if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, domain.ObjectID, time.Time) error); ok {
80		r2 = returnFunc(ctx, repo, head, since)
81	} else {
82		r2 = ret.Error(2)
83	}
84	return r0, r1, r2
85}
86
87// RepoReader_CommitTimes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CommitTimes'
88type RepoReader_CommitTimes_Call struct {
89	*mock.Call
90}
91
92// CommitTimes is a helper method to define mock.On call
93//   - ctx context.Context
94//   - repo domain.RepoName
95//   - head domain.ObjectID
96//   - since time.Time
97func (_e *RepoReader_Expecter) CommitTimes(ctx any, repo any, head any, since any) *RepoReader_CommitTimes_Call {
98	return &RepoReader_CommitTimes_Call{Call: _e.mock.On("CommitTimes", ctx, repo, head, since)}
99}
100
101func (_c *RepoReader_CommitTimes_Call) Run(run func(ctx context.Context, repo domain.RepoName, head domain.ObjectID, since time.Time)) *RepoReader_CommitTimes_Call {
102	_c.Call.Run(func(args mock.Arguments) {
103		var arg0 context.Context
104		if args[0] != nil {
105			arg0 = args[0].(context.Context)
106		}
107		var arg1 domain.RepoName
108		if args[1] != nil {
109			arg1 = args[1].(domain.RepoName)
110		}
111		var arg2 domain.ObjectID
112		if args[2] != nil {
113			arg2 = args[2].(domain.ObjectID)
114		}
115		var arg3 time.Time
116		if args[3] != nil {
117			arg3 = args[3].(time.Time)
118		}
119		run(
120			arg0,
121			arg1,
122			arg2,
123			arg3,
124		)
125	})
126	return _c
127}
128
129func (_c *RepoReader_CommitTimes_Call) Return(times []time.Time, truncated bool, err error) *RepoReader_CommitTimes_Call {
130	_c.Call.Return(times, truncated, err)
131	return _c
132}
133
134func (_c *RepoReader_CommitTimes_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, head domain.ObjectID, since time.Time) ([]time.Time, bool, error)) *RepoReader_CommitTimes_Call {
135	_c.Call.Return(run)
136	return _c
137}
138
139// CountCommits provides a mock function for the type RepoReader
140func (_mock *RepoReader) CountCommits(ctx context.Context, repo domain.RepoName, head domain.ObjectID) (int, error) {
141	ret := _mock.Called(ctx, repo, head)
142
143	if len(ret) == 0 {
144		panic("no return value specified for CountCommits")
145	}
146
147	var r0 int
148	var r1 error
149	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) (int, error)); ok {
150		return returnFunc(ctx, repo, head)
151	}
152	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID) int); ok {
153		r0 = returnFunc(ctx, repo, head)
154	} else {
155		r0 = ret.Get(0).(int)
156	}
157	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID) error); ok {
158		r1 = returnFunc(ctx, repo, head)
159	} else {
160		r1 = ret.Error(1)
161	}
162	return r0, r1
163}
164
165// RepoReader_CountCommits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountCommits'
166type RepoReader_CountCommits_Call struct {
167	*mock.Call
168}
169
170// CountCommits is a helper method to define mock.On call
171//   - ctx context.Context
172//   - repo domain.RepoName
173//   - head domain.ObjectID
174func (_e *RepoReader_Expecter) CountCommits(ctx any, repo any, head any) *RepoReader_CountCommits_Call {
175	return &RepoReader_CountCommits_Call{Call: _e.mock.On("CountCommits", ctx, repo, head)}
176}
177
178func (_c *RepoReader_CountCommits_Call) Run(run func(ctx context.Context, repo domain.RepoName, head domain.ObjectID)) *RepoReader_CountCommits_Call {
179	_c.Call.Run(func(args mock.Arguments) {
180		var arg0 context.Context
181		if args[0] != nil {
182			arg0 = args[0].(context.Context)
183		}
184		var arg1 domain.RepoName
185		if args[1] != nil {
186			arg1 = args[1].(domain.RepoName)
187		}
188		var arg2 domain.ObjectID
189		if args[2] != nil {
190			arg2 = args[2].(domain.ObjectID)
191		}
192		run(
193			arg0,
194			arg1,
195			arg2,
196		)
197	})
198	return _c
199}
200
201func (_c *RepoReader_CountCommits_Call) Return(n int, err error) *RepoReader_CountCommits_Call {
202	_c.Call.Return(n, err)
203	return _c
204}
205
206func (_c *RepoReader_CountCommits_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, head domain.ObjectID) (int, error)) *RepoReader_CountCommits_Call {
207	_c.Call.Return(run)
208	return _c
209}
210
211// GetCommit provides a mock function for the type RepoReader
212func (_mock *RepoReader) GetCommit(ctx context.Context, repo domain.RepoName, rev domain.Revision, limits domain.DiffLimits) (domain.CommitDetail, error) {
213	ret := _mock.Called(ctx, repo, rev, limits)
214
215	if len(ret) == 0 {
216		panic("no return value specified for GetCommit")
217	}
218
219	var r0 domain.CommitDetail
220	var r1 error
221	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.DiffLimits) (domain.CommitDetail, error)); ok {
222		return returnFunc(ctx, repo, rev, limits)
223	}
224	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.DiffLimits) domain.CommitDetail); ok {
225		r0 = returnFunc(ctx, repo, rev, limits)
226	} else {
227		r0 = ret.Get(0).(domain.CommitDetail)
228	}
229	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision, domain.DiffLimits) error); ok {
230		r1 = returnFunc(ctx, repo, rev, limits)
231	} else {
232		r1 = ret.Error(1)
233	}
234	return r0, r1
235}
236
237// RepoReader_GetCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommit'
238type RepoReader_GetCommit_Call struct {
239	*mock.Call
240}
241
242// GetCommit is a helper method to define mock.On call
243//   - ctx context.Context
244//   - repo domain.RepoName
245//   - rev domain.Revision
246//   - limits domain.DiffLimits
247func (_e *RepoReader_Expecter) GetCommit(ctx any, repo any, rev any, limits any) *RepoReader_GetCommit_Call {
248	return &RepoReader_GetCommit_Call{Call: _e.mock.On("GetCommit", ctx, repo, rev, limits)}
249}
250
251func (_c *RepoReader_GetCommit_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, limits domain.DiffLimits)) *RepoReader_GetCommit_Call {
252	_c.Call.Run(func(args mock.Arguments) {
253		var arg0 context.Context
254		if args[0] != nil {
255			arg0 = args[0].(context.Context)
256		}
257		var arg1 domain.RepoName
258		if args[1] != nil {
259			arg1 = args[1].(domain.RepoName)
260		}
261		var arg2 domain.Revision
262		if args[2] != nil {
263			arg2 = args[2].(domain.Revision)
264		}
265		var arg3 domain.DiffLimits
266		if args[3] != nil {
267			arg3 = args[3].(domain.DiffLimits)
268		}
269		run(
270			arg0,
271			arg1,
272			arg2,
273			arg3,
274		)
275	})
276	return _c
277}
278
279func (_c *RepoReader_GetCommit_Call) Return(commitDetail domain.CommitDetail, err error) *RepoReader_GetCommit_Call {
280	_c.Call.Return(commitDetail, err)
281	return _c
282}
283
284func (_c *RepoReader_GetCommit_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, limits domain.DiffLimits) (domain.CommitDetail, error)) *RepoReader_GetCommit_Call {
285	_c.Call.Return(run)
286	return _c
287}
288
289// GetTree provides a mock function for the type RepoReader
290func (_mock *RepoReader) GetTree(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool) (domain.Tree, error) {
291	ret := _mock.Called(ctx, repo, rev, path, includeLastCommit)
292
293	if len(ret) == 0 {
294		panic("no return value specified for GetTree")
295	}
296
297	var r0 domain.Tree
298	var r1 error
299	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath, bool) (domain.Tree, error)); ok {
300		return returnFunc(ctx, repo, rev, path, includeLastCommit)
301	}
302	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath, bool) domain.Tree); ok {
303		r0 = returnFunc(ctx, repo, rev, path, includeLastCommit)
304	} else {
305		r0 = ret.Get(0).(domain.Tree)
306	}
307	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath, bool) error); ok {
308		r1 = returnFunc(ctx, repo, rev, path, includeLastCommit)
309	} else {
310		r1 = ret.Error(1)
311	}
312	return r0, r1
313}
314
315// RepoReader_GetTree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTree'
316type RepoReader_GetTree_Call struct {
317	*mock.Call
318}
319
320// GetTree is a helper method to define mock.On call
321//   - ctx context.Context
322//   - repo domain.RepoName
323//   - rev domain.Revision
324//   - path domain.TreePath
325//   - includeLastCommit bool
326func (_e *RepoReader_Expecter) GetTree(ctx any, repo any, rev any, path any, includeLastCommit any) *RepoReader_GetTree_Call {
327	return &RepoReader_GetTree_Call{Call: _e.mock.On("GetTree", ctx, repo, rev, path, includeLastCommit)}
328}
329
330func (_c *RepoReader_GetTree_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool)) *RepoReader_GetTree_Call {
331	_c.Call.Run(func(args mock.Arguments) {
332		var arg0 context.Context
333		if args[0] != nil {
334			arg0 = args[0].(context.Context)
335		}
336		var arg1 domain.RepoName
337		if args[1] != nil {
338			arg1 = args[1].(domain.RepoName)
339		}
340		var arg2 domain.Revision
341		if args[2] != nil {
342			arg2 = args[2].(domain.Revision)
343		}
344		var arg3 domain.TreePath
345		if args[3] != nil {
346			arg3 = args[3].(domain.TreePath)
347		}
348		var arg4 bool
349		if args[4] != nil {
350			arg4 = args[4].(bool)
351		}
352		run(
353			arg0,
354			arg1,
355			arg2,
356			arg3,
357			arg4,
358		)
359	})
360	return _c
361}
362
363func (_c *RepoReader_GetTree_Call) Return(tree domain.Tree, err error) *RepoReader_GetTree_Call {
364	_c.Call.Return(tree, err)
365	return _c
366}
367
368func (_c *RepoReader_GetTree_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool) (domain.Tree, error)) *RepoReader_GetTree_Call {
369	_c.Call.Return(run)
370	return _c
371}
372
373// LatestTag provides a mock function for the type RepoReader
374func (_mock *RepoReader) LatestTag(ctx context.Context, repo domain.RepoName) (domain.TagInfo, bool, error) {
375	ret := _mock.Called(ctx, repo)
376
377	if len(ret) == 0 {
378		panic("no return value specified for LatestTag")
379	}
380
381	var r0 domain.TagInfo
382	var r1 bool
383	var r2 error
384	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) (domain.TagInfo, bool, error)); ok {
385		return returnFunc(ctx, repo)
386	}
387	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) domain.TagInfo); ok {
388		r0 = returnFunc(ctx, repo)
389	} else {
390		r0 = ret.Get(0).(domain.TagInfo)
391	}
392	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) bool); ok {
393		r1 = returnFunc(ctx, repo)
394	} else {
395		r1 = ret.Get(1).(bool)
396	}
397	if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName) error); ok {
398		r2 = returnFunc(ctx, repo)
399	} else {
400		r2 = ret.Error(2)
401	}
402	return r0, r1, r2
403}
404
405// RepoReader_LatestTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestTag'
406type RepoReader_LatestTag_Call struct {
407	*mock.Call
408}
409
410// LatestTag is a helper method to define mock.On call
411//   - ctx context.Context
412//   - repo domain.RepoName
413func (_e *RepoReader_Expecter) LatestTag(ctx any, repo any) *RepoReader_LatestTag_Call {
414	return &RepoReader_LatestTag_Call{Call: _e.mock.On("LatestTag", ctx, repo)}
415}
416
417func (_c *RepoReader_LatestTag_Call) Run(run func(ctx context.Context, repo domain.RepoName)) *RepoReader_LatestTag_Call {
418	_c.Call.Run(func(args mock.Arguments) {
419		var arg0 context.Context
420		if args[0] != nil {
421			arg0 = args[0].(context.Context)
422		}
423		var arg1 domain.RepoName
424		if args[1] != nil {
425			arg1 = args[1].(domain.RepoName)
426		}
427		run(
428			arg0,
429			arg1,
430		)
431	})
432	return _c
433}
434
435func (_c *RepoReader_LatestTag_Call) Return(tag domain.TagInfo, ok bool, err error) *RepoReader_LatestTag_Call {
436	_c.Call.Return(tag, ok, err)
437	return _c
438}
439
440func (_c *RepoReader_LatestTag_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName) (domain.TagInfo, bool, error)) *RepoReader_LatestTag_Call {
441	_c.Call.Return(run)
442	return _c
443}
444
445// ListCommits provides a mock function for the type RepoReader
446func (_mock *RepoReader) ListCommits(ctx context.Context, repo domain.RepoName, q ports.CommitQuery) (ports.CommitPage, error) {
447	ret := _mock.Called(ctx, repo, q)
448
449	if len(ret) == 0 {
450		panic("no return value specified for ListCommits")
451	}
452
453	var r0 ports.CommitPage
454	var r1 error
455	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.CommitQuery) (ports.CommitPage, error)); ok {
456		return returnFunc(ctx, repo, q)
457	}
458	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.CommitQuery) ports.CommitPage); ok {
459		r0 = returnFunc(ctx, repo, q)
460	} else {
461		r0 = ret.Get(0).(ports.CommitPage)
462	}
463	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, ports.CommitQuery) error); ok {
464		r1 = returnFunc(ctx, repo, q)
465	} else {
466		r1 = ret.Error(1)
467	}
468	return r0, r1
469}
470
471// RepoReader_ListCommits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListCommits'
472type RepoReader_ListCommits_Call struct {
473	*mock.Call
474}
475
476// ListCommits is a helper method to define mock.On call
477//   - ctx context.Context
478//   - repo domain.RepoName
479//   - q ports.CommitQuery
480func (_e *RepoReader_Expecter) ListCommits(ctx any, repo any, q any) *RepoReader_ListCommits_Call {
481	return &RepoReader_ListCommits_Call{Call: _e.mock.On("ListCommits", ctx, repo, q)}
482}
483
484func (_c *RepoReader_ListCommits_Call) Run(run func(ctx context.Context, repo domain.RepoName, q ports.CommitQuery)) *RepoReader_ListCommits_Call {
485	_c.Call.Run(func(args mock.Arguments) {
486		var arg0 context.Context
487		if args[0] != nil {
488			arg0 = args[0].(context.Context)
489		}
490		var arg1 domain.RepoName
491		if args[1] != nil {
492			arg1 = args[1].(domain.RepoName)
493		}
494		var arg2 ports.CommitQuery
495		if args[2] != nil {
496			arg2 = args[2].(ports.CommitQuery)
497		}
498		run(
499			arg0,
500			arg1,
501			arg2,
502		)
503	})
504	return _c
505}
506
507func (_c *RepoReader_ListCommits_Call) Return(commitPage ports.CommitPage, err error) *RepoReader_ListCommits_Call {
508	_c.Call.Return(commitPage, err)
509	return _c
510}
511
512func (_c *RepoReader_ListCommits_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, q ports.CommitQuery) (ports.CommitPage, error)) *RepoReader_ListCommits_Call {
513	_c.Call.Return(run)
514	return _c
515}
516
517// ListPaths provides a mock function for the type RepoReader
518func (_mock *RepoReader) ListPaths(ctx context.Context, repo domain.RepoName, rev domain.Revision, maxPaths int, maxBytes int) (domain.PathList, error) {
519	ret := _mock.Called(ctx, repo, rev, maxPaths, maxBytes)
520
521	if len(ret) == 0 {
522		panic("no return value specified for ListPaths")
523	}
524
525	var r0 domain.PathList
526	var r1 error
527	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, int, int) (domain.PathList, error)); ok {
528		return returnFunc(ctx, repo, rev, maxPaths, maxBytes)
529	}
530	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, int, int) domain.PathList); ok {
531		r0 = returnFunc(ctx, repo, rev, maxPaths, maxBytes)
532	} else {
533		r0 = ret.Get(0).(domain.PathList)
534	}
535	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision, int, int) error); ok {
536		r1 = returnFunc(ctx, repo, rev, maxPaths, maxBytes)
537	} else {
538		r1 = ret.Error(1)
539	}
540	return r0, r1
541}
542
543// RepoReader_ListPaths_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPaths'
544type RepoReader_ListPaths_Call struct {
545	*mock.Call
546}
547
548// ListPaths is a helper method to define mock.On call
549//   - ctx context.Context
550//   - repo domain.RepoName
551//   - rev domain.Revision
552//   - maxPaths int
553//   - maxBytes int
554func (_e *RepoReader_Expecter) ListPaths(ctx any, repo any, rev any, maxPaths any, maxBytes any) *RepoReader_ListPaths_Call {
555	return &RepoReader_ListPaths_Call{Call: _e.mock.On("ListPaths", ctx, repo, rev, maxPaths, maxBytes)}
556}
557
558func (_c *RepoReader_ListPaths_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, maxPaths int, maxBytes int)) *RepoReader_ListPaths_Call {
559	_c.Call.Run(func(args mock.Arguments) {
560		var arg0 context.Context
561		if args[0] != nil {
562			arg0 = args[0].(context.Context)
563		}
564		var arg1 domain.RepoName
565		if args[1] != nil {
566			arg1 = args[1].(domain.RepoName)
567		}
568		var arg2 domain.Revision
569		if args[2] != nil {
570			arg2 = args[2].(domain.Revision)
571		}
572		var arg3 int
573		if args[3] != nil {
574			arg3 = args[3].(int)
575		}
576		var arg4 int
577		if args[4] != nil {
578			arg4 = args[4].(int)
579		}
580		run(
581			arg0,
582			arg1,
583			arg2,
584			arg3,
585			arg4,
586		)
587	})
588	return _c
589}
590
591func (_c *RepoReader_ListPaths_Call) Return(pathList domain.PathList, err error) *RepoReader_ListPaths_Call {
592	_c.Call.Return(pathList, err)
593	return _c
594}
595
596func (_c *RepoReader_ListPaths_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, maxPaths int, maxBytes int) (domain.PathList, error)) *RepoReader_ListPaths_Call {
597	_c.Call.Return(run)
598	return _c
599}
600
601// ListRefs provides a mock function for the type RepoReader
602func (_mock *RepoReader) ListRefs(ctx context.Context, repo domain.RepoName) ([]domain.Ref, error) {
603	ret := _mock.Called(ctx, repo)
604
605	if len(ret) == 0 {
606		panic("no return value specified for ListRefs")
607	}
608
609	var r0 []domain.Ref
610	var r1 error
611	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) ([]domain.Ref, error)); ok {
612		return returnFunc(ctx, repo)
613	}
614	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) []domain.Ref); ok {
615		r0 = returnFunc(ctx, repo)
616	} else {
617		if ret.Get(0) != nil {
618			r0 = ret.Get(0).([]domain.Ref)
619		}
620	}
621	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) error); ok {
622		r1 = returnFunc(ctx, repo)
623	} else {
624		r1 = ret.Error(1)
625	}
626	return r0, r1
627}
628
629// RepoReader_ListRefs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRefs'
630type RepoReader_ListRefs_Call struct {
631	*mock.Call
632}
633
634// ListRefs is a helper method to define mock.On call
635//   - ctx context.Context
636//   - repo domain.RepoName
637func (_e *RepoReader_Expecter) ListRefs(ctx any, repo any) *RepoReader_ListRefs_Call {
638	return &RepoReader_ListRefs_Call{Call: _e.mock.On("ListRefs", ctx, repo)}
639}
640
641func (_c *RepoReader_ListRefs_Call) Run(run func(ctx context.Context, repo domain.RepoName)) *RepoReader_ListRefs_Call {
642	_c.Call.Run(func(args mock.Arguments) {
643		var arg0 context.Context
644		if args[0] != nil {
645			arg0 = args[0].(context.Context)
646		}
647		var arg1 domain.RepoName
648		if args[1] != nil {
649			arg1 = args[1].(domain.RepoName)
650		}
651		run(
652			arg0,
653			arg1,
654		)
655	})
656	return _c
657}
658
659func (_c *RepoReader_ListRefs_Call) Return(refs []domain.Ref, err error) *RepoReader_ListRefs_Call {
660	_c.Call.Return(refs, err)
661	return _c
662}
663
664func (_c *RepoReader_ListRefs_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName) ([]domain.Ref, error)) *RepoReader_ListRefs_Call {
665	_c.Call.Return(run)
666	return _c
667}
668
669// OpenBlob provides a mock function for the type RepoReader
670func (_mock *RepoReader) OpenBlob(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath) (domain.BlobInfo, io.ReadCloser, error) {
671	ret := _mock.Called(ctx, repo, rev, path)
672
673	if len(ret) == 0 {
674		panic("no return value specified for OpenBlob")
675	}
676
677	var r0 domain.BlobInfo
678	var r1 io.ReadCloser
679	var r2 error
680	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath) (domain.BlobInfo, io.ReadCloser, error)); ok {
681		return returnFunc(ctx, repo, rev, path)
682	}
683	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath) domain.BlobInfo); ok {
684		r0 = returnFunc(ctx, repo, rev, path)
685	} else {
686		r0 = ret.Get(0).(domain.BlobInfo)
687	}
688	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath) io.ReadCloser); ok {
689		r1 = returnFunc(ctx, repo, rev, path)
690	} else {
691		if ret.Get(1) != nil {
692			r1 = ret.Get(1).(io.ReadCloser)
693		}
694	}
695	if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath) error); ok {
696		r2 = returnFunc(ctx, repo, rev, path)
697	} else {
698		r2 = ret.Error(2)
699	}
700	return r0, r1, r2
701}
702
703// RepoReader_OpenBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenBlob'
704type RepoReader_OpenBlob_Call struct {
705	*mock.Call
706}
707
708// OpenBlob is a helper method to define mock.On call
709//   - ctx context.Context
710//   - repo domain.RepoName
711//   - rev domain.Revision
712//   - path domain.TreePath
713func (_e *RepoReader_Expecter) OpenBlob(ctx any, repo any, rev any, path any) *RepoReader_OpenBlob_Call {
714	return &RepoReader_OpenBlob_Call{Call: _e.mock.On("OpenBlob", ctx, repo, rev, path)}
715}
716
717func (_c *RepoReader_OpenBlob_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath)) *RepoReader_OpenBlob_Call {
718	_c.Call.Run(func(args mock.Arguments) {
719		var arg0 context.Context
720		if args[0] != nil {
721			arg0 = args[0].(context.Context)
722		}
723		var arg1 domain.RepoName
724		if args[1] != nil {
725			arg1 = args[1].(domain.RepoName)
726		}
727		var arg2 domain.Revision
728		if args[2] != nil {
729			arg2 = args[2].(domain.Revision)
730		}
731		var arg3 domain.TreePath
732		if args[3] != nil {
733			arg3 = args[3].(domain.TreePath)
734		}
735		run(
736			arg0,
737			arg1,
738			arg2,
739			arg3,
740		)
741	})
742	return _c
743}
744
745func (_c *RepoReader_OpenBlob_Call) Return(blobInfo domain.BlobInfo, readCloser io.ReadCloser, err error) *RepoReader_OpenBlob_Call {
746	_c.Call.Return(blobInfo, readCloser, err)
747	return _c
748}
749
750func (_c *RepoReader_OpenBlob_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath) (domain.BlobInfo, io.ReadCloser, error)) *RepoReader_OpenBlob_Call {
751	_c.Call.Return(run)
752	return _c
753}
754
755// ResolveRefPath provides a mock function for the type RepoReader
756func (_mock *RepoReader) ResolveRefPath(ctx context.Context, repo domain.RepoName, path string) (domain.RefPath, error) {
757	ret := _mock.Called(ctx, repo, path)
758
759	if len(ret) == 0 {
760		panic("no return value specified for ResolveRefPath")
761	}
762
763	var r0 domain.RefPath
764	var r1 error
765	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) (domain.RefPath, error)); ok {
766		return returnFunc(ctx, repo, path)
767	}
768	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) domain.RefPath); ok {
769		r0 = returnFunc(ctx, repo, path)
770	} else {
771		r0 = ret.Get(0).(domain.RefPath)
772	}
773	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, string) error); ok {
774		r1 = returnFunc(ctx, repo, path)
775	} else {
776		r1 = ret.Error(1)
777	}
778	return r0, r1
779}
780
781// RepoReader_ResolveRefPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveRefPath'
782type RepoReader_ResolveRefPath_Call struct {
783	*mock.Call
784}
785
786// ResolveRefPath is a helper method to define mock.On call
787//   - ctx context.Context
788//   - repo domain.RepoName
789//   - path string
790func (_e *RepoReader_Expecter) ResolveRefPath(ctx any, repo any, path any) *RepoReader_ResolveRefPath_Call {
791	return &RepoReader_ResolveRefPath_Call{Call: _e.mock.On("ResolveRefPath", ctx, repo, path)}
792}
793
794func (_c *RepoReader_ResolveRefPath_Call) Run(run func(ctx context.Context, repo domain.RepoName, path string)) *RepoReader_ResolveRefPath_Call {
795	_c.Call.Run(func(args mock.Arguments) {
796		var arg0 context.Context
797		if args[0] != nil {
798			arg0 = args[0].(context.Context)
799		}
800		var arg1 domain.RepoName
801		if args[1] != nil {
802			arg1 = args[1].(domain.RepoName)
803		}
804		var arg2 string
805		if args[2] != nil {
806			arg2 = args[2].(string)
807		}
808		run(
809			arg0,
810			arg1,
811			arg2,
812		)
813	})
814	return _c
815}
816
817func (_c *RepoReader_ResolveRefPath_Call) Return(refPath domain.RefPath, err error) *RepoReader_ResolveRefPath_Call {
818	_c.Call.Return(refPath, err)
819	return _c
820}
821
822func (_c *RepoReader_ResolveRefPath_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, path string) (domain.RefPath, error)) *RepoReader_ResolveRefPath_Call {
823	_c.Call.Return(run)
824	return _c
825}
826
827// ResolveRevision provides a mock function for the type RepoReader
828func (_mock *RepoReader) ResolveRevision(ctx context.Context, repo domain.RepoName, rev domain.Revision) (domain.ResolvedRevision, error) {
829	ret := _mock.Called(ctx, repo, rev)
830
831	if len(ret) == 0 {
832		panic("no return value specified for ResolveRevision")
833	}
834
835	var r0 domain.ResolvedRevision
836	var r1 error
837	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision) (domain.ResolvedRevision, error)); ok {
838		return returnFunc(ctx, repo, rev)
839	}
840	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision) domain.ResolvedRevision); ok {
841		r0 = returnFunc(ctx, repo, rev)
842	} else {
843		r0 = ret.Get(0).(domain.ResolvedRevision)
844	}
845	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision) error); ok {
846		r1 = returnFunc(ctx, repo, rev)
847	} else {
848		r1 = ret.Error(1)
849	}
850	return r0, r1
851}
852
853// RepoReader_ResolveRevision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveRevision'
854type RepoReader_ResolveRevision_Call struct {
855	*mock.Call
856}
857
858// ResolveRevision is a helper method to define mock.On call
859//   - ctx context.Context
860//   - repo domain.RepoName
861//   - rev domain.Revision
862func (_e *RepoReader_Expecter) ResolveRevision(ctx any, repo any, rev any) *RepoReader_ResolveRevision_Call {
863	return &RepoReader_ResolveRevision_Call{Call: _e.mock.On("ResolveRevision", ctx, repo, rev)}
864}
865
866func (_c *RepoReader_ResolveRevision_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision)) *RepoReader_ResolveRevision_Call {
867	_c.Call.Run(func(args mock.Arguments) {
868		var arg0 context.Context
869		if args[0] != nil {
870			arg0 = args[0].(context.Context)
871		}
872		var arg1 domain.RepoName
873		if args[1] != nil {
874			arg1 = args[1].(domain.RepoName)
875		}
876		var arg2 domain.Revision
877		if args[2] != nil {
878			arg2 = args[2].(domain.Revision)
879		}
880		run(
881			arg0,
882			arg1,
883			arg2,
884		)
885	})
886	return _c
887}
888
889func (_c *RepoReader_ResolveRevision_Call) Return(resolvedRevision domain.ResolvedRevision, err error) *RepoReader_ResolveRevision_Call {
890	_c.Call.Return(resolvedRevision, err)
891	return _c
892}
893
894func (_c *RepoReader_ResolveRevision_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision) (domain.ResolvedRevision, error)) *RepoReader_ResolveRevision_Call {
895	_c.Call.Return(run)
896	return _c
897}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 4

Tags 45

↑↓ moveenter openesc close