88	"github.com/go-errors/errors" 
99	"github.com/jesseduffield/lazygit/pkg/commands/models" 
1010	"github.com/jesseduffield/lazygit/pkg/commands/oscommands" 
11- 	"github.com/jesseduffield/lazygit/pkg/commands/types/enums" 
1211	"github.com/jesseduffield/lazygit/pkg/config" 
1312	"github.com/jesseduffield/lazygit/pkg/utils" 
1413	"github.com/stefanhaller/git-todo-parser/todo" 
@@ -33,17 +32,15 @@ func TestGetCommits(t *testing.T) {
3332		expectedCommits  []* models.Commit 
3433		expectedError    error 
3534		logOrder         string 
36- 		rebaseMode       enums.RebaseMode 
3735		opts             GetCommitsOptions 
3836		mainBranches     []string 
3937	}
4038
4139	scenarios  :=  []scenario {
4240		{
43- 			testName :   "should return no commits if there are none" ,
44- 			logOrder :   "topo-order" ,
45- 			rebaseMode : enums .REBASE_MODE_NONE ,
46- 			opts :       GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
41+ 			testName : "should return no commits if there are none" ,
42+ 			logOrder : "topo-order" ,
43+ 			opts :     GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
4744			runner : oscommands .NewFakeRunner (t ).
4845				ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
4946				ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
@@ -52,10 +49,9 @@ func TestGetCommits(t *testing.T) {
5249			expectedError :   nil ,
5350		},
5451		{
55- 			testName :   "should use proper upstream name for branch" ,
56- 			logOrder :   "topo-order" ,
57- 			rebaseMode : enums .REBASE_MODE_NONE ,
58- 			opts :       GetCommitsOptions {RefName : "refs/heads/mybranch" , RefForPushedStatus : "refs/heads/mybranch" , IncludeRebaseCommits : false },
52+ 			testName : "should use proper upstream name for branch" ,
53+ 			logOrder : "topo-order" ,
54+ 			opts :     GetCommitsOptions {RefName : "refs/heads/mybranch" , RefForPushedStatus : "refs/heads/mybranch" , IncludeRebaseCommits : false },
5955			runner : oscommands .NewFakeRunner (t ).
6056				ExpectGitArgs ([]string {"merge-base" , "refs/heads/mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
6157				ExpectGitArgs ([]string {"log" , "refs/heads/mybranch" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
@@ -66,7 +62,6 @@ func TestGetCommits(t *testing.T) {
6662		{
6763			testName :     "should return commits if they are present" ,
6864			logOrder :     "topo-order" ,
69- 			rebaseMode :   enums .REBASE_MODE_NONE ,
7065			opts :         GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
7166			mainBranches : []string {"master" , "main" , "develop" },
7267			runner : oscommands .NewFakeRunner (t ).
@@ -203,7 +198,6 @@ func TestGetCommits(t *testing.T) {
203198		{
204199			testName :     "should not call merge-base for mainBranches if none exist" ,
205200			logOrder :     "topo-order" ,
206- 			rebaseMode :   enums .REBASE_MODE_NONE ,
207201			opts :         GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
208202			mainBranches : []string {"master" , "main" },
209203			runner : oscommands .NewFakeRunner (t ).
@@ -240,7 +234,6 @@ func TestGetCommits(t *testing.T) {
240234		{
241235			testName :     "should call merge-base for all main branches that exist" ,
242236			logOrder :     "topo-order" ,
243- 			rebaseMode :   enums .REBASE_MODE_NONE ,
244237			opts :         GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
245238			mainBranches : []string {"master" , "main" , "develop" , "1.0-hotfixes" },
246239			runner : oscommands .NewFakeRunner (t ).
@@ -277,10 +270,9 @@ func TestGetCommits(t *testing.T) {
277270			expectedError : nil ,
278271		},
279272		{
280- 			testName :   "should not specify order if `log.order` is `default`" ,
281- 			logOrder :   "default" ,
282- 			rebaseMode : enums .REBASE_MODE_NONE ,
283- 			opts :       GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
273+ 			testName : "should not specify order if `log.order` is `default`" ,
274+ 			logOrder : "default" ,
275+ 			opts :     GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
284276			runner : oscommands .NewFakeRunner (t ).
285277				ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
286278				ExpectGitArgs ([]string {"log" , "HEAD" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
@@ -289,10 +281,9 @@ func TestGetCommits(t *testing.T) {
289281			expectedError :   nil ,
290282		},
291283		{
292- 			testName :   "should set filter path" ,
293- 			logOrder :   "default" ,
294- 			rebaseMode : enums .REBASE_MODE_NONE ,
295- 			opts :       GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , FilterPath : "src" },
284+ 			testName : "should set filter path" ,
285+ 			logOrder : "default" ,
286+ 			opts :     GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , FilterPath : "src" },
296287			runner : oscommands .NewFakeRunner (t ).
297288				ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
298289				ExpectGitArgs ([]string {"log" , "HEAD" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s" , "--abbrev=40" , "--follow" , "--no-show-signature" , "--" , "src" }, "" , nil ),
@@ -310,10 +301,10 @@ func TestGetCommits(t *testing.T) {
310301			cmd  :=  oscommands .NewDummyCmdObjBuilder (scenario .runner )
311302
312303			builder  :=  & CommitLoader {
313- 				Common :        common ,
314- 				cmd :           cmd ,
315- 				getRebaseMode : func () (enums. RebaseMode ,  error )  { return  scenario . rebaseMode ,  nil  },
316- 				dotGitDir :     ".git" ,
304+ 				Common :               common ,
305+ 				cmd :                  cmd ,
306+ 				getWorkingTreeState : func () models. WorkingTreeState   { return  models. WorkingTreeState {}  },
307+ 				dotGitDir :            ".git" ,
317308				readFile : func (filename  string ) ([]byte , error ) {
318309					return  []byte ("" ), nil 
319310				},
@@ -493,10 +484,10 @@ func TestCommitLoader_getConflictedCommitImpl(t *testing.T) {
493484			common  :=  utils .NewDummyCommon ()
494485
495486			builder  :=  & CommitLoader {
496- 				Common :        common ,
497- 				cmd :           oscommands .NewDummyCmdObjBuilder (oscommands .NewFakeRunner (t )),
498- 				getRebaseMode : func () (enums. RebaseMode ,  error )  { return  enums . REBASE_MODE_INTERACTIVE ,  nil  },
499- 				dotGitDir :     ".git" ,
487+ 				Common :               common ,
488+ 				cmd :                  oscommands .NewDummyCmdObjBuilder (oscommands .NewFakeRunner (t )),
489+ 				getWorkingTreeState : func () models. WorkingTreeState   { return  models. WorkingTreeState { Rebasing :  true }  },
490+ 				dotGitDir :            ".git" ,
500491				readFile : func (filename  string ) ([]byte , error ) {
501492					return  []byte ("" ), nil 
502493				},
0 commit comments