30e23a643ba4f892c42e8d8d8a2ab31a6e68a9a6

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

refactor(cli): fix `commit.gpgsign` test in `omz pr test`

Diff

 1diff --git a/lib/cli.zsh b/lib/cli.zsh
 2index 56d5b91de886c56c34590142194269546eb735af..b71f6d9cee6314195288855e130bdc23265118a1 100644
 3--- a/lib/cli.zsh
 4+++ b/lib/cli.zsh
 5@@ -573,14 +573,13 @@ function _omz::pr::test {
 6 
 7     # Rebase pull request branch against the current master
 8     _omz::log info "rebasing PR #$1..."
 9-    local gpgsign
10+    local ret gpgsign
11     {
12       # Back up commit.gpgsign setting: use --local to get the current repository
13       # setting, not the global one. If --local is not a known option, it will
14       # exit with a 129 status code.
15-      if ! gpgsign=$(command git config --local commit.gpgsign 2>/dev/null); then
16-        [[ $? -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null)
17-      fi
18+      gpgsign=$(command git config --local commit.gpgsign 2>/dev/null) || ret=$?
19+      [[ $ret -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null)
20       command git config commit.gpgsign false
21 
22       command git rebase master ohmyzsh/pull-$1 || {