summaryrefslogtreecommitdiff
path: root/pre-commit.d/20warn-hardlinks
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-04 17:38:10 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-04 17:38:10 -0500
commit788ae5a34c0fad2e3c0788a745400a138d735195 (patch)
tree2517eb3ccf206f4ed7b6ef6a1d543c87caaf2e41 /pre-commit.d/20warn-hardlinks
parent69739dd0341ba72a645344ea14658f0ede006079 (diff)
parentfd4a85189390d6e6f022eb8f71fcecb5d5f82958 (diff)
Merge branch 'hg'
Significantly refactored
Diffstat (limited to 'pre-commit.d/20warn-hardlinks')
-rwxr-xr-xpre-commit.d/20warn-hardlinks11
1 files changed, 7 insertions, 4 deletions
diff --git a/pre-commit.d/20warn-hardlinks b/pre-commit.d/20warn-hardlinks
index 3dd7a96..8716dbd 100755
--- a/pre-commit.d/20warn-hardlinks
+++ b/pre-commit.d/20warn-hardlinks
@@ -1,7 +1,10 @@
#!/bin/sh
set -e
-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
+
+if [ "$VCS" = git ] || [ "$VCS" = hg ]; then
+ hardlinks=$(find -type f -not -links 1 | grep -v /.git/) || true
+ if [ -n "$hardlinks" ]; then
+ echo "etckeeper warning: hardlinked files could cause problems with $VCS:" >&2
+ echo "$hardlinks" >&2
+ fi
fi