From 30e23a643ba4f892c42e8d8d8a2ab31a6e68a9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 14 Apr 2022 12:13:53 +0200 Subject: [PATCH] refactor(cli): fix `commit.gpgsign` test in `omz pr test` --- lib/cli.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index 56d5b91de..b71f6d9ce 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -573,14 +573,13 @@ function _omz::pr::test { # Rebase pull request branch against the current master _omz::log info "rebasing PR #$1..." - local gpgsign + local ret gpgsign { # 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. - if ! gpgsign=$(command git config --local commit.gpgsign 2>/dev/null); then - [[ $? -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null) - fi + gpgsign=$(command git config --local commit.gpgsign 2>/dev/null) || ret=$? + [[ $ret -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null) command git config commit.gpgsign false command git rebase master ohmyzsh/pull-$1 || {