@@ -59,13 +59,13 @@ async function initBareRepo(repositoryUrl, branch = 'master') {
59
59
*
60
60
* @returns {Array<Commit> } The created commits, in reverse order (to match `git log` order).
61
61
*/
62
- async function gitCommits ( messages , execaOpts ) {
62
+ async function gitCommits ( messages , execaOptions ) {
63
63
await pReduce (
64
64
messages ,
65
65
async ( _ , message ) =>
66
- ( await execa ( 'git' , [ 'commit' , '-m' , message , '--allow-empty' , '--no-gpg-sign' ] , execaOpts ) ) . stdout
66
+ ( await execa ( 'git' , [ 'commit' , '-m' , message , '--allow-empty' , '--no-gpg-sign' ] , execaOptions ) ) . stdout
67
67
) ;
68
- return ( await gitGetCommits ( undefined , execaOpts ) ) . slice ( 0 , messages . length ) ;
68
+ return ( await gitGetCommits ( undefined , execaOptions ) ) . slice ( 0 , messages . length ) ;
69
69
}
70
70
71
71
/**
@@ -76,11 +76,14 @@ async function gitCommits(messages, execaOpts) {
76
76
*
77
77
* @return {Array<Object> } The list of parsed commits.
78
78
*/
79
- async function gitGetCommits ( from , execaOpts ) {
79
+ async function gitGetCommits ( from , execaOptions ) {
80
80
Object . assign ( gitLogParser . fields , { hash : 'H' , message : 'B' , gitTags : 'd' , committerDate : { key : 'ci' , type : Date } } ) ;
81
81
return (
82
82
await getStream . array (
83
- gitLogParser . parse ( { _ : `${ from ? from + '..' : '' } HEAD` } , { ...execaOpts , env : { ...process . env , ...execaOpts . env } } )
83
+ gitLogParser . parse (
84
+ { _ : `${ from ? from + '..' : '' } HEAD` } ,
85
+ { ...execaOptions , env : { ...process . env , ...execaOptions . env } }
86
+ )
84
87
)
85
88
) . map ( commit => {
86
89
commit . message = commit . message . trim ( ) ;
@@ -96,8 +99,8 @@ async function gitGetCommits(from, execaOpts) {
96
99
* @param {Boolean } create to create the branch, `false` to checkout an existing branch.
97
100
* @param {Object } [execaOpts] Options to pass to `execa`.
98
101
*/
99
- async function gitCheckout ( branch , create , execaOpts ) {
100
- await execa ( 'git' , create ? [ 'checkout' , '-b' , branch ] : [ 'checkout' , branch ] , execaOpts ) ;
102
+ async function gitCheckout ( branch , create , execaOptions ) {
103
+ await execa ( 'git' , create ? [ 'checkout' , '-b' , branch ] : [ 'checkout' , branch ] , execaOptions ) ;
101
104
}
102
105
103
106
/**
@@ -107,8 +110,8 @@ async function gitCheckout(branch, create, execaOpts) {
107
110
* @param {String } [sha] The commit on which to create the tag. If undefined the tag is created on the last commit.
108
111
* @param {Object } [execaOpts] Options to pass to `execa`.
109
112
*/
110
- async function gitTagVersion ( tagName , sha , execaOpts ) {
111
- await execa ( 'git' , sha ? [ 'tag' , '-f' , tagName , sha ] : [ 'tag' , tagName ] , execaOpts ) ;
113
+ async function gitTagVersion ( tagName , sha , execaOptions ) {
114
+ await execa ( 'git' , sha ? [ 'tag' , '-f' , tagName , sha ] : [ 'tag' , tagName ] , execaOptions ) ;
112
115
}
113
116
114
117
/**
@@ -154,8 +157,8 @@ async function gitDetachedHead(repositoryUrl, head) {
154
157
*
155
158
* @return {String } The HEAD sha of the remote repository.
156
159
*/
157
- async function gitRemoteHead ( repositoryUrl , execaOpts ) {
158
- return ( await execa ( 'git' , [ 'ls-remote' , repositoryUrl , 'HEAD' ] , execaOpts ) ) . stdout
160
+ async function gitRemoteHead ( repositoryUrl , execaOptions ) {
161
+ return ( await execa ( 'git' , [ 'ls-remote' , repositoryUrl , 'HEAD' ] , execaOptions ) ) . stdout
159
162
. split ( '\n' )
160
163
. filter ( head => Boolean ( head ) )
161
164
. map ( head => head . match ( / ^ (?< head > \S + ) / ) [ 1 ] ) [ 0 ] ;
@@ -168,8 +171,8 @@ async function gitRemoteHead(repositoryUrl, execaOpts) {
168
171
*
169
172
* @return {Array<String> } Array of staged files path.
170
173
*/
171
- async function gitStaged ( execaOpts ) {
172
- return ( await execa ( 'git' , [ 'status' , '--porcelain' ] , execaOpts ) ) . stdout
174
+ async function gitStaged ( execaOptions ) {
175
+ return ( await execa ( 'git' , [ 'status' , '--porcelain' ] , execaOptions ) ) . stdout
173
176
. split ( '\n' )
174
177
. filter ( status => status . startsWith ( 'A ' ) )
175
178
. map ( status => status . match ( / ^ A \s + (?< file > .+ ) $ / ) [ 1 ] ) ;
@@ -183,8 +186,8 @@ async function gitStaged(execaOpts) {
183
186
*
184
187
* @return {Array<String> } The list of files path included in the commit.
185
188
*/
186
- async function gitCommitedFiles ( ref , execaOpts ) {
187
- return ( await execa ( 'git' , [ 'diff-tree' , '-r' , '--name-only' , '--no-commit-id' , '-r' , ref ] , execaOpts ) ) . stdout
189
+ async function gitCommitedFiles ( ref , execaOptions ) {
190
+ return ( await execa ( 'git' , [ 'diff-tree' , '-r' , '--name-only' , '--no-commit-id' , '-r' , ref ] , execaOptions ) ) . stdout
188
191
. split ( '\n' )
189
192
. filter ( file => Boolean ( file ) ) ;
190
193
}
@@ -195,8 +198,8 @@ async function gitCommitedFiles(ref, execaOpts) {
195
198
* @param {Array<String> } files Array of files path to add to the index.
196
199
* @param {Object } [execaOpts] Options to pass to `execa`.
197
200
*/
198
- async function gitAdd ( files , execaOpts ) {
199
- await execa ( 'git' , [ 'add' , '--force' , '--ignore-errors' , ...files ] , { ...execaOpts } ) ;
201
+ async function gitAdd ( files , execaOptions ) {
202
+ await execa ( 'git' , [ 'add' , '--force' , '--ignore-errors' , ...files ] , { ...execaOptions } ) ;
200
203
}
201
204
202
205
/**
@@ -206,8 +209,8 @@ async function gitAdd(files, execaOpts) {
206
209
* @param {String } branch The branch to push.
207
210
* @param {Object } [execaOpts] Options to pass to `execa`.
208
211
*/
209
- async function gitPush ( repositoryUrl , branch , execaOpts ) {
210
- await execa ( 'git' , [ 'push' , '--tags' , repositoryUrl , `HEAD:${ branch } ` ] , execaOpts ) ;
212
+ async function gitPush ( repositoryUrl , branch , execaOptions ) {
213
+ await execa ( 'git' , [ 'push' , '--tags' , repositoryUrl , `HEAD:${ branch } ` ] , execaOptions ) ;
211
214
}
212
215
213
216
module . exports = {
0 commit comments