summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-04-14 12:05:02 +0200
committerMarc Cornellà <hello@mcornella.com>2022-04-14 12:08:59 +0200
commitf1a5fb5ee99f51f06a18b7b0ffecd8763f8d96d6 (patch)
treef7af9a37a544918737ed67f778ac6bd6eaaef42b /lib
parent7ea6ff8d04acd665ebcd151d183ec67af5be1281 (diff)
downloadzsh-f1a5fb5ee99f51f06a18b7b0ffecd8763f8d96d6.tar.gz
zsh-f1a5fb5ee99f51f06a18b7b0ffecd8763f8d96d6.tar.bz2
zsh-f1a5fb5ee99f51f06a18b7b0ffecd8763f8d96d6.zip
fix(cli): fix `commit.gpgsign` test in `omz pr test`
Since `set -e` is enabled, when `commit.gpgsign` is not set the `git config` command would show an error. Given that it is technically not ignored, the subshell would exit. With this change, the `commit.gpgsign` setting is properly tested by doing the fallback test if the command fails, so no exit status code ends up quiting the subshell.
Diffstat (limited to 'lib')
-rw-r--r--lib/cli.zsh5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/cli.zsh b/lib/cli.zsh
index bf783d9f3..56d5b91de 100644
--- a/lib/cli.zsh
+++ b/lib/cli.zsh
@@ -578,8 +578,9 @@ function _omz::pr::test {
# Back up commit.gpgsign setting: use --local to get the current repository
# setting, not the global one. If --local is not a known option, it will
# exit with a 129 status code.
- gpgsign=$(command git config --local commit.gpgsign 2>/dev/null)
- [[ $? -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null)
+ if ! gpgsign=$(command git config --local commit.gpgsign 2>/dev/null); then
+ [[ $? -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null)
+ fi
command git config commit.gpgsign false
command git rebase master ohmyzsh/pull-$1 || {