]> code.delx.au - gnu-emacs/commitdiff
Fix autogen.sh for separate worktrees
authorNoam Postavsky <npostavs@gmail.com>
Thu, 5 May 2016 04:09:22 +0000 (21:09 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 5 May 2016 04:11:37 +0000 (21:11 -0700)
* autogen.sh: Use the $hooks variable in the $sample_hooks loop, instead
of assuming .git/hooks is a directory.

autogen.sh

index cd0accd6793c1b442be8702a1caf77fa2977effb..3809942acf4bb27af3f740f9fc49ccc20c538543 100755 (executable)
@@ -327,8 +327,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