summaryrefslogtreecommitdiff
path: root/pre-commit.d/20store-empty-directory
diff options
context:
space:
mode:
Diffstat (limited to 'pre-commit.d/20store-empty-directory')
-rwxr-xr-xpre-commit.d/20store-empty-directory28
1 files changed, 0 insertions, 28 deletions
diff --git a/pre-commit.d/20store-empty-directory b/pre-commit.d/20store-empty-directory
deleted file mode 100755
index 22fde89..0000000
--- a/pre-commit.d/20store-empty-directory
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-set -e
-
-# These version control systems do not track directories, so empty
-# directories must be stored specially.
-if [ "$VCS" = git ] || [ "$VCS" = hg ]; then
- # Make sure the file is not readable by others, since it can leak
- # information about contents of non-readable directories in /etc.
- umask 077
-
- if [ -e .etckeeper ]; then
- egrep -v '^mkdir ' .etckeeper > .etckeeper.new || true
- fi
- find -type d -empty | grep -v /.git/ | grep -v /.hg/ | grep -v /.bzr/ |
- sort | sed -e "s/^/mkdir -p '/" -e "s/\$/'/" >> .etckeeper.new
-
- if [ ! -e .etckeeper ] || ! cmp -s .etckeeper .etckeeper.new ; then
- mv -f .etckeeper.new .etckeeper
- # stage the file as part of the current commit
- if [ "$VCS" = git ]; then
- git add .etckeeper
- fi
- # hg add not done, hg will automatically include the file
- # in the current commit
- else
- rm -f .etckeeper.new
- fi
-fi