]> git.eshelyaron.com Git - emacs.git/commitdiff
autogen.sh: omit bogus chatter if no .git
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 7 Sep 2017 07:10:05 +0000 (00:10 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 7 Sep 2017 07:10:54 +0000 (00:10 -0700)
Problem reported by Angelo Graziosi in:
http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00045.html
* autogen.sh (git_config): Do not execut 'git' if $do_git fails.

autogen.sh

index 0d00d56762a48542a75efb4f6f4ea749d86542eb..b3c5f486e96dee763617f05986fac781e9bbd85f 100755 (executable)
@@ -269,23 +269,23 @@ fi
 
 git_config ()
 {
+    $do_git || return
+
     name=$1
     value=$2
 
     ovalue=`git config --get "$name"` && test "$ovalue" = "$value" || {
-       if $do_git; then
-           if $git_was_ok; then
-               echo 'Configuring local git repository...'
-               case $cp_options in
-                 --backup=*)
-                   config=$git_common_dir/config
-                   cp $cp_options --force -- "$config" "$config" || exit;;
-               esac
-           fi
-           echo "git config $name '$value'"
-           git config "$name" "$value" || exit
-       fi
-       git_was_ok=false
+       if $git_was_ok; then
+          echo 'Configuring local git repository...'
+          case $cp_options in
+              --backup=*)
+                  config=$git_common_dir/config
+                  cp $cp_options --force -- "$config" "$config" || exit;;
+          esac
+       fi
+       echo "git config $name '$value'"
+       git config "$name" "$value" || exit
+       git_was_ok=false
     }
 }