mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-27 15:30:15 +08:00
fix(cli): turn of commit.gpgsign
compatibly with git v1.7.1 (#10679)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
This commit is contained in:
parent
93435bff49
commit
141d06b602
17
lib/cli.zsh
17
lib/cli.zsh
@ -573,13 +573,28 @@ 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..."
|
||||||
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
|
command git rebase --abort &>/dev/null
|
||||||
_omz::log warn "could not rebase PR #$1 on top of master."
|
_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 warn "you might not see the latest stable changes."
|
||||||
_omz::log info "run \`zsh\` to test the changes."
|
_omz::log info "run \`zsh\` to test the changes."
|
||||||
return 1
|
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."
|
_omz::log info "fetch of PR #${1} successful."
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user