@@ -60,8 +60,10 @@ export async function initBareRepo(repositoryUrl, branch = 'master') {
60
60
* @returns {Array<Commit> } The created commits, in reverse order (to match `git log` order).
61
61
*/
62
62
export async function gitCommits ( messages , execaOpts ) {
63
- await pReduce ( messages , ( _ , message ) =>
64
- execa . stdout ( 'git' , [ 'commit' , '-m' , message , '--allow-empty' , '--no-gpg-sign' ] , execaOpts )
63
+ await pReduce (
64
+ messages ,
65
+ async ( _ , message ) =>
66
+ ( await execa ( 'git' , [ 'commit' , '-m' , message , '--allow-empty' , '--no-gpg-sign' ] , execaOpts ) ) . stdout
65
67
) ;
66
68
return ( await gitGetCommits ( undefined , execaOpts ) ) . slice ( 0 , messages . length ) ;
67
69
}
@@ -151,7 +153,7 @@ export async function gitDetachedHead(repositoryUrl, head) {
151
153
* @return {String } The HEAD sha of the remote repository.
152
154
*/
153
155
export async function gitRemoteHead ( repositoryUrl , execaOpts ) {
154
- return ( await execa . stdout ( 'git' , [ 'ls-remote' , repositoryUrl , 'HEAD' ] , execaOpts ) )
156
+ return ( await execa ( 'git' , [ 'ls-remote' , repositoryUrl , 'HEAD' ] , execaOpts ) ) . stdout
155
157
. split ( '\n' )
156
158
. filter ( head => Boolean ( head ) )
157
159
. map ( head => head . match ( / ^ ( \S + ) / ) [ 1 ] ) [ 0 ] ;
@@ -165,7 +167,7 @@ export async function gitRemoteHead(repositoryUrl, execaOpts) {
165
167
* @return {Array<String> } Array of staged files path.
166
168
*/
167
169
export async function gitStaged ( execaOpts ) {
168
- return ( await execa . stdout ( 'git' , [ 'status' , '--porcelain' ] , execaOpts ) )
170
+ return ( await execa ( 'git' , [ 'status' , '--porcelain' ] , execaOpts ) ) . stdout
169
171
. split ( '\n' )
170
172
. filter ( status => status . startsWith ( 'A ' ) )
171
173
. map ( status => status . match ( / ^ A \s + ( .+ ) $ / ) [ 1 ] ) ;
@@ -180,7 +182,7 @@ export async function gitStaged(execaOpts) {
180
182
* @return {Array<String> } The list of files path included in the commit.
181
183
*/
182
184
export async function gitCommitedFiles ( ref = 'HEAD' , execaOpts ) {
183
- return ( await execa . stdout ( 'git' , [ 'diff-tree' , '-r' , '--name-only' , '--no-commit-id' , '-r' , ref ] , execaOpts ) )
185
+ return ( await execa ( 'git' , [ 'diff-tree' , '-r' , '--name-only' , '--no-commit-id' , '-r' , ref ] , execaOpts ) ) . stdout
184
186
. split ( '\n' )
185
187
. filter ( file => Boolean ( file ) ) ;
186
188
}
0 commit comments