diff --git a/dev/git-hooks/pre-commit.sh b/dev/git-hooks/pre-commit.sh
index 9225fe93451377bcf64eb87f0bf8892838f87e71..5333e2b62eb19f3179948abe78c40a01bdc03680 100755
--- a/dev/git-hooks/pre-commit.sh
+++ b/dev/git-hooks/pre-commit.sh
@@ -23,8 +23,8 @@
 
 # Example of installation of this pre-commit hook (client side):
 # - (cd .git/hooks/ && ln -s ../../dev/git-hooks/pre-commit.sh pre-commit)
-# Note: if you decide to copy the file, the `SCRIPT_DIR` variable must be
-# fixed accordingly.
+
+ROOT=$(git rev-parse --show-toplevel)
 
 echo "Pre-commit Hook..."
 
@@ -36,5 +36,4 @@ then
   exit 0
 fi
 
-SCRIPT_DIR=$(dirname -- "$( readlink -f -- "$0"; )")
-"$SCRIPT_DIR/../check-files.sh" -c || exit 1
+"$ROOT/dev/check-files.sh" -c || exit 1