summaryrefslogtreecommitdiff
path: root/pre-commit.d
diff options
context:
space:
mode:
Diffstat (limited to 'pre-commit.d')
-rwxr-xr-xpre-commit.d/10store-metadata1
-rwxr-xr-xpre-commit.d/10warn-empty-directory2
-rwxr-xr-xpre-commit.d/10warn-hardlinks2
-rwxr-xr-xpre-commit.d/10warn-special-file4
4 files changed, 6 insertions, 3 deletions
diff --git a/pre-commit.d/10store-metadata b/pre-commit.d/10store-metadata
index c1a6c27..322a3ae 100755
--- a/pre-commit.d/10store-metadata
+++ b/pre-commit.d/10store-metadata
@@ -1,3 +1,4 @@
#!/bin/sh
set -e
metastore --save --mtime
+git add .metadata
diff --git a/pre-commit.d/10warn-empty-directory b/pre-commit.d/10warn-empty-directory
index eed41ae..3f6cdaa 100755
--- a/pre-commit.d/10warn-empty-directory
+++ b/pre-commit.d/10warn-empty-directory
@@ -1,6 +1,6 @@
#!/bin/sh
set -e
-empty=$(find -type f -empty | grep -v /.git/)
+empty=$(find -type f -empty | grep -v /.git/) || true
if [ -n "$empty" ]; then
echo "etckeeper warning: empty directories, not tracked by git:" >&2
echo "$empty" >&2
diff --git a/pre-commit.d/10warn-hardlinks b/pre-commit.d/10warn-hardlinks
index 29f007b..3dd7a96 100755
--- a/pre-commit.d/10warn-hardlinks
+++ b/pre-commit.d/10warn-hardlinks
@@ -1,6 +1,6 @@
#!/bin/sh
set -e
-hardlinks=$(find -type f -not -links 1 | grep -v /.git/)
+hardlinks=$(find -type f -not -links 1 | grep -v /.git/) || true
if [ -n "$hardlinks" ]; then
echo "etckeeper warning: hardlinked files could cause problems with git:" >&2
echo "$hardlinks" >&2
diff --git a/pre-commit.d/10warn-special-file b/pre-commit.d/10warn-special-file
index aa5c683..cb4d019 100755
--- a/pre-commit.d/10warn-special-file
+++ b/pre-commit.d/10warn-special-file
@@ -1,7 +1,9 @@
#!/bin/sh
set -e
-special=$(find -not -type d -not -type f -not -type l | grep -v /.git/)
+special=$(find -not -type d -not -type f -not -type l | grep -v /.git/) || true
if [ -n "$special" ]; then
echo "etckeeper warning: special files could cause problems with git:" >&2
echo "$special" >&2
fi
+
+true