diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2007-11-05 17:30:39 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2007-11-05 17:30:39 -0500 |
commit | f0522c931958b7dccca733229254f2e37f0ef20c (patch) | |
tree | 01c3964078b47200e3d624dccd3dafa10d18311f | |
parent | c01f3fe97eadce94a2f37908dc57f54d9af5b25a (diff) |
support git commit being run in a subdir
Store the toplevel directory of the repo in the pre-commit hook, and cd to
there. This is not ideal, but good enough.
-rwxr-xr-x | etckeeper | 2 | ||||
-rwxr-xr-x | init.d/40git-pre-commit-hook | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -19,6 +19,8 @@ fi if [ "$command" = post-apt ] || [ "$command" = pre-apt ]; then cd /etc +elif [ "$command" = pre-commit ]; then + chdir "$1" fi run-parts "/etc/etckeeper/$command.d" diff --git a/init.d/40git-pre-commit-hook b/init.d/40git-pre-commit-hook index cf96c1e..88eb581 100755 --- a/init.d/40git-pre-commit-hook +++ b/init.d/40git-pre-commit-hook @@ -10,7 +10,7 @@ else # pre-commit hook for etckeeper. Calls etckeeper-pre-commit to store metadata # and do sanity checks. set -e -etckeeper-pre-commit +etckeeper-pre-commit `pwd` EOF chmod +x .git/hooks/pre-commit fi |