@@ -140,10 +140,22 @@ describe('create-or-update-branch tests', () => {
140
140
} )
141
141
142
142
async function beforeTest ( ) : Promise < void > {
143
+ await git . fetch (
144
+ [ `${ DEFAULT_BRANCH } :${ DEFAULT_BRANCH } ` ] ,
145
+ REMOTE_NAME ,
146
+ [ '--force' , '--update-head-ok' ] ,
147
+ true
148
+ )
143
149
await git . checkout ( DEFAULT_BRANCH )
144
150
}
145
151
146
152
async function afterTest ( deleteRemote = true ) : Promise < void > {
153
+ await git . fetch (
154
+ [ `${ DEFAULT_BRANCH } :${ DEFAULT_BRANCH } ` ] ,
155
+ REMOTE_NAME ,
156
+ [ '--force' , '--update-head-ok' ] ,
157
+ true
158
+ )
147
159
await git . checkout ( DEFAULT_BRANCH )
148
160
try {
149
161
// Get the upstream branch if it exists
@@ -1454,8 +1466,7 @@ describe('create-or-update-branch tests', () => {
1454
1466
expect (
1455
1467
await gitLogMatches ( [
1456
1468
_commitMessage ,
1457
- ...commits . commitMsgs ,
1458
- INIT_COMMIT_MESSAGE
1469
+ commits . commitMsgs [ 0 ] // fetch depth of base is 1
1459
1470
] )
1460
1471
) . toBeTruthy ( )
1461
1472
} )
@@ -1590,7 +1601,9 @@ describe('create-or-update-branch tests', () => {
1590
1601
expect ( await getFileContent ( TRACKED_FILE ) ) . toEqual ( _changes . tracked )
1591
1602
expect ( await getFileContent ( UNTRACKED_FILE ) ) . toEqual ( _changes . untracked )
1592
1603
expect (
1593
- await gitLogMatches ( [ ...commits . commitMsgs , INIT_COMMIT_MESSAGE ] )
1604
+ await gitLogMatches ( [
1605
+ commits . commitMsgs [ 0 ] // fetch depth of base is 1
1606
+ ] )
1594
1607
) . toBeTruthy ( )
1595
1608
} )
1596
1609
@@ -1668,7 +1681,9 @@ describe('create-or-update-branch tests', () => {
1668
1681
expect ( await getFileContent ( TRACKED_FILE ) ) . toEqual ( _changes . tracked )
1669
1682
expect ( await getFileContent ( UNTRACKED_FILE ) ) . toEqual ( _changes . untracked )
1670
1683
expect (
1671
- await gitLogMatches ( [ ...commits . commitMsgs , INIT_COMMIT_MESSAGE ] )
1684
+ await gitLogMatches ( [
1685
+ commits . commitMsgs [ 0 ] // fetch depth of base is 1
1686
+ ] )
1672
1687
) . toBeTruthy ( )
1673
1688
} )
1674
1689
@@ -1951,8 +1966,7 @@ describe('create-or-update-branch tests', () => {
1951
1966
await gitLogMatches ( [
1952
1967
_commitMessage ,
1953
1968
..._commits . commitMsgs ,
1954
- ...commitsOnBase . commitMsgs ,
1955
- INIT_COMMIT_MESSAGE
1969
+ commitsOnBase . commitMsgs [ 0 ] // fetch depth of base is 1
1956
1970
] )
1957
1971
) . toBeTruthy ( )
1958
1972
} )
@@ -2147,8 +2161,7 @@ describe('create-or-update-branch tests', () => {
2147
2161
expect (
2148
2162
await gitLogMatches ( [
2149
2163
_commitMessage ,
2150
- ...commitsOnBase . commitMsgs ,
2151
- INIT_COMMIT_MESSAGE
2164
+ commitsOnBase . commitMsgs [ 0 ] // fetch depth of base is 1
2152
2165
] )
2153
2166
) . toBeTruthy ( )
2154
2167
} )
0 commit comments