summaryrefslogtreecommitdiff
path: root/pre-commit.d/30store-metadata
diff options
context:
space:
mode:
Diffstat (limited to 'pre-commit.d/30store-metadata')
-rwxr-xr-xpre-commit.d/30store-metadata13
1 files changed, 5 insertions, 8 deletions
diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata
index c3927e0..93e1202 100755
--- a/pre-commit.d/30store-metadata
+++ b/pre-commit.d/30store-metadata
@@ -54,16 +54,13 @@ generate_metadata() {
if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then
- # ensure the file exists so that it will list its own metadata
- if [ ! -e .etckeeper ]; then
- touch .etckeeper
- # Make sure the file is not readable by others, since it can leak
- # information about contents of non-readable directories in /etc.
- chmod 700 .etckeeper
- fi
-
echo "# Generated by etckeeper. Do not edit." > .etckeeper
echo >> .etckeeper
+
+ # Make sure the file is not readable by others, since it can leak
+ # information about contents of non-readable directories in /etc.
+ chmod 700 .etckeeper
+
generate_metadata >> .etckeeper
# stage the file as part of the current commit