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
1 changed files with 4 additions and 2 deletions

6
dup
View File

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