aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-11-30 17:43:08 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-11-30 17:43:08 -0200
commit073832fae2972ba5507fc0703a28acc2fb9b8216 (patch)
treeb4cff9c447cb4cf929a69c5c52f4d9f83bbe12b0
parentac14d4ddca54043b8a33170a5c5c31ee4b25c3cc (diff)
downloadutils-git-073832fae2972ba5507fc0703a28acc2fb9b8216.tar.gz
utils-git-073832fae2972ba5507fc0703a28acc2fb9b8216.tar.bz2
Do not output differences at git-config-{save,restore}
-rwxr-xr-xgit-config-save5
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"