]> gitweb.fluxo.info Git - utils-git.git/commitdiff
Do not output differences at git-config-{save,restore}
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 30 Nov 2017 19:43:08 +0000 (17:43 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 30 Nov 2017 19:43:08 +0000 (17:43 -0200)
git-config-save

index d7d12e99f181bbc2357f7b9e320f60652845ec04..9e742d17d1f6931b570aec9bf58cbc27f4ec6693 100755 (executable)
@@ -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"