Fix dup -s to only stage when there are changes

This commit is contained in:
Adam Goldsmith 2019-01-15 22:06:11 -05:00
parent 927c8e8cda
commit 2016ea1b2d

6
dup
View File

@ -23,10 +23,12 @@ function do_get() {
function do_pull() { function do_pull() {
if [ "$stashAndSync" = true ] if [ "$stashAndSync" = true ]
then then
git stash local do_stash
do_stash=$(git diff)
[ -n "$do_stash" ] && git stash
git pull --rebase git pull --rebase
git push git push
git stash pop || true [ -n "$do_stash" ] && git stash pop || true
fi fi
} }