From 8ad5536688b1dadf9b44d9df9a25ede9124a10e3 Mon Sep 17 00:00:00 2001 From: Martin von Gagern Date: Mon, 7 Aug 2017 03:52:06 +0100 Subject: [PATCH] Initialize git submodules Some packages make use of git submodules, and require all of them to be in place to be installed. One example is my libtidy wrapper for node, which depends on the C sources for libtidy (unless a precompiled binary is available for a given platform). I've been asked to add pre-commit support in https://github.com/gagern/node-libtidy/issues/17 but testing that failed because the source tree was lacking its submodules. --- pre_commit/store.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pre_commit/store.py b/pre_commit/store.py index ee1f755b..84fc2123 100644 --- a/pre_commit/store.py +++ b/pre_commit/store.py @@ -123,6 +123,10 @@ class Store(object): ) with cwd(directory): cmd_output('git', 'reset', ref, '--hard', env=no_git_env()) + cmd_output( + 'git', 'submodule', 'update', '--init', '--recursive', + env=no_git_env(), + ) return self._new_repo(repo, ref, clone_strategy)