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:
parent
3eb1cdef72
commit
d45565f83b
10 changed files with 87 additions and 102 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue