summaryrefslogtreecommitdiff
path: root/etckeeper
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2007-11-05 17:30:39 -0500
committerJoey Hess <joey@kodama.kitenet.net>2007-11-05 17:30:39 -0500
commitf0522c931958b7dccca733229254f2e37f0ef20c (patch)
tree01c3964078b47200e3d624dccd3dafa10d18311f /etckeeper
parentc01f3fe97eadce94a2f37908dc57f54d9af5b25a (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.
Diffstat (limited to 'etckeeper')
-rwxr-xr-xetckeeper2
1 files changed, 2 insertions, 0 deletions
diff --git a/etckeeper b/etckeeper
index 9550311..c05845d 100755
--- a/etckeeper
+++ b/etckeeper
@@ -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"