summaryrefslogtreecommitdiff
path: root/lib/cli.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2022-04-02 13:24:35 -0500
committerTuowen Zhao <ztuowen@gmail.com>2022-04-02 13:24:35 -0500
commit2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945 (patch)
tree99add95300f57806b89bd885a5f5322ce9f9ac1a /lib/cli.zsh
parentcae9a2b797649379e865e6bd73bc67e294e4ac77 (diff)
parent53863e7b3ff0c2e2816e90dab3d870adebdf49c7 (diff)
downloadzsh-2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945.tar.gz
zsh-2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945.tar.bz2
zsh-2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'lib/cli.zsh')
-rw-r--r--lib/cli.zsh27
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/cli.zsh b/lib/cli.zsh
index c2fba8556..bf783d9f3 100644
--- a/lib/cli.zsh
+++ b/lib/cli.zsh
@@ -573,12 +573,27 @@ 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 || {
- 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
+ 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."