diff options
Diffstat (limited to 'pre-commit.d/20warn-hardlinks')
-rwxr-xr-x | pre-commit.d/20warn-hardlinks | 11 |
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 |