summaryrefslogtreecommitdiff
path: root/pre-commit.d/20warn-hardlinks
blob: 008e2f1de9e0df286cc510ed945d7517a8ed0101 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
set -e

if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then
	hardlinks=$(find -type f -not -links 1 | grep -v '/\(.git\|.hg\|.bzr\|_darcs\)/' ) || true
	if [ -n "$hardlinks" ]; then
		echo "etckeeper warning: hardlinked files could cause problems with $VCS:" >&2
		echo "$hardlinks" >&2
	fi
fi