@@ -87,12 +87,14 @@ class LandingSession extends Session {
87
87
await runAsync ( 'git' , [
88
88
'fetch' , `https://github.com/${ owner } /${ repo } .git` ,
89
89
`refs/pull/${ prid } /merge` ] ) ;
90
- const [ base , head ] = ( await runAsync ( 'git' , [
91
- 'rev-parse' , 'FETCH_HEAD^1' , 'FETCH_HEAD^2' ] , { captureStdout : true } ) )
92
- . split ( '\n' ) ;
93
- const commitShas = ( await runAsync ( 'git' , [
94
- 'rev-list' , `${ base } ..${ head } ` ] , { captureStdout : true } ) )
95
- . trim ( ) . split ( '\n' ) ;
90
+ // We fetched the commit that would result if we used `git merge`.
91
+ // ^1 and ^2 refer to the PR base and the PR head, respectively.
92
+ const [ base , head ] = await runAsync ( 'git' ,
93
+ [ 'rev-parse' , 'FETCH_HEAD^1' , 'FETCH_HEAD^2' ] ,
94
+ { captureStdout : 'lines' } ) ;
95
+ const commitShas = await runAsync ( 'git' ,
96
+ [ 'rev-list' , `${ base } ..${ head } ` ] ,
97
+ { captureStdout : 'lines' } ) ;
96
98
cli . stopSpinner ( `Fetched commits as ${ shortSha ( base ) } ..${ shortSha ( head ) } ` ) ;
97
99
cli . separator ( ) ;
98
100
@@ -188,9 +190,9 @@ class LandingSession extends Session {
188
190
189
191
async tryCompleteLanding ( commitInfo ) {
190
192
const { cli } = this ;
191
- const subjects = ( await runAsync ( 'git' ,
193
+ const subjects = await runAsync ( 'git' ,
192
194
[ 'log' , '--pretty=format:%s' , `${ commitInfo . base } ..${ commitInfo . head } ` ] ,
193
- { captureStdout : true } ) ) . trim ( ) . split ( '\n' ) ;
195
+ { captureStdout : 'lines' } ) ;
194
196
195
197
if ( commitInfo . shas . length === 1 ) {
196
198
const shouldAmend = await cli . prompt (
0 commit comments