@@ -33,7 +33,7 @@ func TestGetCommits(t *testing.T) {
33
33
logOrder string
34
34
rebaseMode enums.RebaseMode
35
35
opts GetCommitsOptions
36
- baseBranches []string
36
+ mainBranches []string
37
37
}
38
38
39
39
scenarios := []scenario {
@@ -66,13 +66,13 @@ func TestGetCommits(t *testing.T) {
66
66
logOrder : "topo-order" ,
67
67
rebaseMode : enums .REBASE_MODE_NONE ,
68
68
opts : GetCommitsOptions {RefName : "HEAD" , IncludeRebaseCommits : false },
69
- baseBranches : []string {"master" , "main" },
69
+ mainBranches : []string {"master" , "main" },
70
70
runner : oscommands .NewFakeRunner (t ).
71
71
// here it's seeing which commits are yet to be pushed
72
72
Expect (`git merge-base "HEAD" "HEAD"@{u}` , "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
73
73
// here it's actually getting all the commits in a formatted form, one per line
74
74
Expect (`git log "HEAD" --topo-order --oneline --pretty=format:"%H%x00%at%x00%aN%x00%ae%x00%d%x00%p%x00%s" --abbrev=40 --no-show-signature --` , commitsOutput , nil ).
75
- // here it's testing which of the configured base branches exist
75
+ // here it's testing which of the configured main branches exist
76
76
Expect (`git rev-parse --verify --quiet "refs/heads/master"` , "" , nil ). // this one does
77
77
Expect (`git rev-parse --verify --quiet "refs/heads/main"` , "" , errors .New ("error" )). // this one doesn't
78
78
// here it's seeing where our branch diverged from the master branch so that we can mark that commit and parent commits as 'merged'
@@ -195,17 +195,17 @@ func TestGetCommits(t *testing.T) {
195
195
expectedError : nil ,
196
196
},
197
197
{
198
- testName : "should not call merge-base for baseBranches if none exist" ,
198
+ testName : "should not call merge-base for mainBranches if none exist" ,
199
199
logOrder : "topo-order" ,
200
200
rebaseMode : enums .REBASE_MODE_NONE ,
201
201
opts : GetCommitsOptions {RefName : "HEAD" , IncludeRebaseCommits : false },
202
- baseBranches : []string {"master" , "main" },
202
+ mainBranches : []string {"master" , "main" },
203
203
runner : oscommands .NewFakeRunner (t ).
204
204
// here it's seeing which commits are yet to be pushed
205
205
Expect (`git merge-base "HEAD" "HEAD"@{u}` , "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
206
206
// here it's actually getting all the commits in a formatted form, one per line
207
207
Expect (`git log "HEAD" --topo-order --oneline --pretty=format:"%H%x00%at%x00%aN%x00%ae%x00%d%x00%p%x00%s" --abbrev=40 --no-show-signature --` , singleCommitOutput , nil ).
208
- // here it's testing which of the configured base branches exist; neither does
208
+ // here it's testing which of the configured main branches exist; neither does
209
209
Expect (`git rev-parse --verify --quiet "refs/heads/master"` , "" , errors .New ("error" )).
210
210
Expect (`git rev-parse --verify --quiet "refs/heads/main"` , "" , errors .New ("error" )),
211
211
@@ -228,17 +228,17 @@ func TestGetCommits(t *testing.T) {
228
228
expectedError : nil ,
229
229
},
230
230
{
231
- testName : "should call merge-base for all base branches that exist" ,
231
+ testName : "should call merge-base for all main branches that exist" ,
232
232
logOrder : "topo-order" ,
233
233
rebaseMode : enums .REBASE_MODE_NONE ,
234
234
opts : GetCommitsOptions {RefName : "HEAD" , IncludeRebaseCommits : false },
235
- baseBranches : []string {"master" , "main" , "develop" , "1.0-hotfixes" },
235
+ mainBranches : []string {"master" , "main" , "develop" , "1.0-hotfixes" },
236
236
runner : oscommands .NewFakeRunner (t ).
237
237
// here it's seeing which commits are yet to be pushed
238
238
Expect (`git merge-base "HEAD" "HEAD"@{u}` , "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
239
239
// here it's actually getting all the commits in a formatted form, one per line
240
240
Expect (`git log "HEAD" --topo-order --oneline --pretty=format:"%H%x00%at%x00%aN%x00%ae%x00%d%x00%p%x00%s" --abbrev=40 --no-show-signature --` , singleCommitOutput , nil ).
241
- // here it's testing which of the configured base branches exist
241
+ // here it's testing which of the configured main branches exist
242
242
Expect (`git rev-parse --verify --quiet "refs/heads/master"` , "" , nil ).
243
243
Expect (`git rev-parse --verify --quiet "refs/heads/main"` , "" , errors .New ("error" )).
244
244
Expect (`git rev-parse --verify --quiet "refs/heads/develop"` , "" , nil ).
@@ -309,7 +309,7 @@ func TestGetCommits(t *testing.T) {
309
309
},
310
310
}
311
311
312
- common .UserConfig .Git .BaseBranches = scenario .baseBranches
312
+ common .UserConfig .Git .MainBranches = scenario .mainBranches
313
313
commits , err := builder .GetCommits (scenario .opts )
314
314
315
315
assert .Equal (t , scenario .expectedCommits , commits )
0 commit comments