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

parent f1a5fb5e
...@@ -573,14 +573,13 @@ function _omz::pr::test { ...@@ -573,14 +573,13 @@ function _omz::pr::test {
# Rebase pull request branch against the current master # Rebase pull request branch against the current master
_omz::log info "rebasing PR #$1..." _omz::log info "rebasing PR #$1..."
local gpgsign local ret gpgsign
{ {
# Back up commit.gpgsign setting: use --local to get the current repository # 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 # setting, not the global one. If --local is not a known option, it will
# exit with a 129 status code. # exit with a 129 status code.
if ! gpgsign=$(command git config --local commit.gpgsign 2>/dev/null); then gpgsign=$(command git config --local commit.gpgsign 2>/dev/null) || ret=$?
[[ $? -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null) [[ $ret -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null)
fi
command git config commit.gpgsign false command git config commit.gpgsign false
command git rebase master ohmyzsh/pull-$1 || { command git rebase master ohmyzsh/pull-$1 || {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment