@@ -60,8 +60,10 @@ export async function initBareRepo(repositoryUrl, branch = 'master') {
6060 * @returns {Array<Commit> } The created commits, in reverse order (to match `git log` order).
6161 */
6262export 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
6567 ) ;
6668 return ( await gitGetCommits ( undefined , execaOpts ) ) . slice ( 0 , messages . length ) ;
6769}
@@ -151,7 +153,7 @@ export async function gitDetachedHead(repositoryUrl, head) {
151153 * @return {String } The HEAD sha of the remote repository.
152154 */
153155export 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
155157 . split ( '\n' )
156158 . filter ( head => Boolean ( head ) )
157159 . map ( head => head . match ( / ^ ( \S + ) / ) [ 1 ] ) [ 0 ] ;
@@ -165,7 +167,7 @@ export async function gitRemoteHead(repositoryUrl, execaOpts) {
165167 * @return {Array<String> } Array of staged files path.
166168 */
167169export async function gitStaged ( execaOpts ) {
168- return ( await execa . stdout ( 'git' , [ 'status' , '--porcelain' ] , execaOpts ) )
170+ return ( await execa ( 'git' , [ 'status' , '--porcelain' ] , execaOpts ) ) . stdout
169171 . split ( '\n' )
170172 . filter ( status => status . startsWith ( 'A ' ) )
171173 . map ( status => status . match ( / ^ A \s + ( .+ ) $ / ) [ 1 ] ) ;
@@ -180,7 +182,7 @@ export async function gitStaged(execaOpts) {
180182 * @return {Array<String> } The list of files path included in the commit.
181183 */
182184export 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
184186 . split ( '\n' )
185187 . filter ( file => Boolean ( file ) ) ;
186188}
0 commit comments