Handle gpg signing better (#1123)

Instead of checking whether it was set previously, setting it to false,
then setting it back to true if it was true before, just use the
command-line argument in git to override the config for that command.
Using a variable makes it pretty painless to do.
This commit is contained in:
Kyle Wood 2018-05-24 13:41:50 -05:00 committed by Zach
parent 3eb1cdef72
commit d45565f83b
10 changed files with 87 additions and 102 deletions

View file

@ -1,5 +1,7 @@
#!/usr/bin/env bash
gitcmd="git -c commit.gpgsign=false"
color() {
if [ $2 ]; then
echo -e "\e[$1;$2m"
@ -12,11 +14,11 @@ colorend() {
}
paperstash() {
STASHED=$(git stash 2>/dev/null|| return 0) # errors are ok
STASHED=$($gitcmd stash 2>/dev/null|| return 0) # errors are ok
}
paperunstash() {
if [[ "$STASHED" != "No local changes to save" ]] ; then
git stash pop 2>/dev/null|| return 0 # errors are ok
$gitcmd stash pop 2>/dev/null|| return 0 # errors are ok
fi
}