diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-12-21 04:33:20 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-12-21 04:40:06 -0600 |
commit | 0cac67b2703e7956c460e2e1f741c3453a2b173b (patch) | |
tree | f9095163f0aa8beec603084ca55dd7f56e6ab292 /g | |
parent | d0d07cd2975c1fb783d0f8591dd3a4931d1c5be5 (diff) |
set-up the hooks for submodules for recent git setup
Change-Id: I52482d017966e1d9671f92f43ec9d8cac6daf602
Diffstat (limited to 'g')
-rwxr-xr-x | g | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -52,7 +52,24 @@ local hook_name ln -sf "${COREDIR?}/${repo?}/.git-hooks/${hook_name?}" "${hook?}" fi done + elif [ -d .git/modules/${repo}/hooks ] ; then + for hook_name in $(ls -1 ${COREDIR?}/.git-hooks) ; do + hook=".git/modules/${repo?}/hooks/${hook_name?}" + if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then + rm -f "${hook?}" + ln -sf "${COREDIR?}/.git-hooks/${hook_name?}" "${hook?}" + fi + done + # override if need be by the submodules' own hooks + for hook_name in $(ls -1 ${COREDIR?}/${repo?}/.git-hooks 2>/dev/null) ; do + hook=".git/modules/${repo?}/hooks/${hook_name?}" + if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then + rm -f "${hook?}" + ln -sf "${COREDIR?}/${repo?}/.git-hooks/${hook_name?}" "${hook?}" + fi + done fi + } refresh_all_hooks() |