From 2016ea1b2dcfee54267da039f2bc99379367538b Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 15 Jan 2019 22:06:11 -0500 Subject: [PATCH] Fix dup -s to only stage when there are changes --- dup | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dup b/dup index 5d9a3f1..acfde75 100755 --- a/dup +++ b/dup @@ -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 }