diff options
-rwxr-xr-x | git-config-save | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/git-config-save b/git-config-save index d7d12e9..9e742d1 100755 --- a/git-config-save +++ b/git-config-save @@ -71,7 +71,8 @@ function git_config_save { mkdir -p $BASE/$ID # Make a backup - if [ -f "$BASE/$ID/config" ] && ! diff .git/config $BASE/$ID/config; then + if [ -f "$BASE/$ID/config" ] && ! diff .git/config $BASE/$ID/config &> /dev/null; then + echo "Differences detected at `pwd`, making a backup..." cp $BASE/$ID/config $BASE/$ID/config.$DATE fi @@ -104,7 +105,7 @@ function git_config_restore { fi # Make a backup - if ! diff .git/config $BASE/$ID/config; then + if ! diff .git/config $BASE/$ID/config &> /dev/null; then cp .git/config .git/config.$DATE else echo "Identical configs for `pwd`, skipping" |