From 6441707441baf055c9278387c2f40054ea966456 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Thu, 10 Sep 2015 10:19:53 +0200 Subject: [PATCH] Add support for submodules. --- pre-commit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pre-commit b/pre-commit index 3ae1399..c0efacd 100755 --- a/pre-commit +++ b/pre-commit @@ -9,7 +9,9 @@ res=0 REP=/tmp/_$$ while true; do - if [ -d .git ]; then + # Either we are in a Git repository or in a submodule. Note that only + # submodules into the root directory are supported. + if [ -d .git -o -d ../.git/modules/$(basename $PWD) ]; then break; fi cd .. -- 2.11.4.GIT