]> code.delx.au - gnu-emacs/blobdiff - autogen.sh
* test/lisp/help-fns-tests.el: Add several tests for 'describe-function'.
[gnu-emacs] / autogen.sh
index cd0accd6793c1b442be8702a1caf77fa2977effb..b1bd86b461483ead5ed3c2a24e18dbd318c17f59 100755 (executable)
@@ -277,8 +277,10 @@ git_config ()
 # Get location of Git's common configuration directory.  For older Git
 # versions this is just '.git'.  Newer Git versions support worktrees.
 
-test -e .git && git_common_dir=`git rev-parse --git-common-dir 2>/dev/null` ||
-  git_common_dir=.git
+{ test -e .git &&
+  git_common_dir=`git rev-parse --no-flags --git-common-dir 2>/dev/null` &&
+  test -n "$git_common_dir"
+} || git_common_dir=.git
 hooks=$git_common_dir/hooks
 
 # Check hashes when transferring objects among repositories.
@@ -327,8 +329,9 @@ if test -n "$tailored_hooks$sample_hooks"; then
 
        if test -n "$sample_hooks"; then
            for hook in $sample_hooks; do
-               cp $cp_options -- "$hooks/$hook.sample" "$hooks/$hook" || exit
-               chmod a-w .git/hooks/$hook || exit
+               dst=$hooks/$hook
+               cp $cp_options -- "$dst.sample" "$dst" || exit
+               chmod -- a-w "$dst" || exit
            done
        fi
     else