Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41ddbec

Browse files
committed
Pass exec options through gpgExec
1 parent bbc0a4b commit 41ddbec

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/git-shell-out-strategy.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,13 @@ export default class GitShellOutStrategy {
207207
* Execute a git command that may create a commit. If the command fails because the GPG binary was invoked and unable
208208
* to acquire a passphrase (because the pinentry program attempted to use a tty), retry with a `GitPromptServer`.
209209
*/
210-
gpgExec(args, {stdin} = {stdin: null}) {
210+
gpgExec(args, options = {}) {
211211
const gpgArgs = ['-c', `gpg.program=${GPG_HELPER_PATH}`].concat(args);
212-
return this.exec(gpgArgs, {stdin, writeOperation: true}).catch(err => {
213-
if (err.code === 128 && /gpg failed/.test(err.stdErr)) {
212+
return this.exec(gpgArgs, options).catch(err => {
213+
if (err.code === 128 && /gpg failed/.test(err.stdErr) && !options.useGitPromptServer) {
214214
// Retry with a GitPromptServer
215-
return this.exec(gpgArgs, {stdin, useGitPromptServer: true, writeOperation: true});
215+
options.useGitPromptServer = true;
216+
return this.exec(gpgArgs, options);
216217
} else {
217218
throw err;
218219
}
@@ -415,7 +416,7 @@ export default class GitShellOutStrategy {
415416
* Merge
416417
*/
417418
merge(branchName) {
418-
return this.gpgExec(['merge', branchName]);
419+
return this.gpgExec(['merge', branchName], {writeOperation: true});
419420
}
420421

421422
async isMerging() {

0 commit comments

Comments
 (0)