From 0c3e92294618e8465f5c426161929251894e7594 Mon Sep 17 00:00:00 2001 From: Scott Bronson Date: Thu, 20 Mar 2008 02:44:12 -0700 Subject: find has a bug where pruned directories are considered empty, even if they're not. Therefore we'll revert to the previous empty directory finding code. The previous code would let "mkdir -p './.git'" into .etckeeper (no big deal but still wrong). --- pre-commit.d/30store-metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pre-commit.d') diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index 93e1202..e5dcd77 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -28,8 +28,8 @@ generate_metadata() { if [ "$VCS" = git ] || [ "$VCS" = hg ]; then # These version control systems do not track directories, # so empty directories must be stored specially. - find $NOVCS -type d -empty | sort | \ - sed -e "s/^/mkdir -p '/" -e "s/\$/'/" + find -type d -empty | grep -v /.git/ | grep -v /.hg/ | grep -v /.bzr/ | + sort | sed -e "s/^/mkdir -p '/" -e "s/\$/'/" fi # Find all files and directories that don't have root as the owner -- cgit v1.2.3