Unverified Commit 141d06b6 authored by Carlo Sala's avatar Carlo Sala Committed by GitHub

fix(cli): turn of `commit.gpgsign` compatibly with git v1.7.1 (#10679)

Co-authored-by: 's avatarMarc Cornellà <hello@mcornella.com>
parent 93435bff
......@@ -573,13 +573,28 @@ function _omz::pr::test {
# Rebase pull request branch against the current master
_omz::log info "rebasing PR #$1..."
command git rebase --no-gpg-sign master ohmyzsh/pull-$1 || {
local 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.
gpgsign=$(command git config --local commit.gpgsign 2>/dev/null)
[[ $? -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null)
command git config commit.gpgsign false
command git rebase master ohmyzsh/pull-$1 || {
command git rebase --abort &>/dev/null
_omz::log warn "could not rebase PR #$1 on top of master."
_omz::log warn "you might not see the latest stable changes."
_omz::log info "run \`zsh\` to test the changes."
return 1
}
} always {
case "$gpgsign" in
"") command git config --unset commit.gpgsign ;;
*) command git config commit.gpgsign "$gpgsign" ;;
esac
}
_omz::log info "fetch of PR #${1} successful."
)
......
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