mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
Factor out CommitLoader.mainBranches into its own class, and store it in Model
This commit is contained in:
parent
b2011dca35
commit
f4d922bc80
7 changed files with 116 additions and 68 deletions
|
@ -307,10 +307,11 @@ func TestGetCommits(t *testing.T) {
|
|||
common := utils.NewDummyCommon()
|
||||
common.AppState = &config.AppState{}
|
||||
common.AppState.GitLogOrder = scenario.logOrder
|
||||
cmd := oscommands.NewDummyCmdObjBuilder(scenario.runner)
|
||||
|
||||
builder := &CommitLoader{
|
||||
Common: common,
|
||||
cmd: oscommands.NewDummyCmdObjBuilder(scenario.runner),
|
||||
cmd: cmd,
|
||||
getRebaseMode: func() (enums.RebaseMode, error) { return scenario.rebaseMode, nil },
|
||||
dotGitDir: ".git",
|
||||
readFile: func(filename string) ([]byte, error) {
|
||||
|
@ -322,7 +323,9 @@ func TestGetCommits(t *testing.T) {
|
|||
}
|
||||
|
||||
common.UserConfig.Git.MainBranches = scenario.mainBranches
|
||||
commits, err := builder.GetCommits(scenario.opts)
|
||||
opts := scenario.opts
|
||||
opts.MainBranches = NewMainBranches(scenario.mainBranches, cmd)
|
||||
commits, err := builder.GetCommits(opts)
|
||||
|
||||
assert.Equal(t, scenario.expectedCommits, commits)
|
||||
assert.Equal(t, scenario.expectedError, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue