diff options
author | Scott Bronson <b.git@u32.net> | 2008-03-20 02:44:12 -0700 |
---|---|---|
committer | Scott Bronson <b.git@u32.net> | 2008-03-20 02:44:12 -0700 |
commit | 0c3e92294618e8465f5c426161929251894e7594 (patch) | |
tree | 76e7bb9e69536bf8617e3997fbd071e773b31dc6 /pre-commit.d/30store-metadata | |
parent | f45ff34100d7e3302ced6a3bdf46c15b5a1ac3b4 (diff) |
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).
Diffstat (limited to 'pre-commit.d/30store-metadata')
-rwxr-xr-x | pre-commit.d/30store-metadata | 4 |
1 files changed, 2 insertions, 2 deletions
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 |