mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-15 23:42:41 +00:00
When running a git hook, git sets certain environment variables (such as GIT_INDEX_FILE) which force git to look at the main repository, overriding other options. This trips up code_style.py whenever it tries to run a git command on the framework submodule. Fix this by explicitly clearing git-related environment-variables before running git commands on the framework. This is recommended by git's documentation[1]: > Environment variables, such as GIT_DIR, GIT_WORK_TREE, etc., are > exported so that Git commands run by the hook can correctly locate > the repository. If your hook needs to invoke Git commands in a > foreign repository or in a different working tree of the same > repository, then it should clear these environment variables so > they do not interfere with Git operations at the foreign location. [1] https://git-scm.com/docs/githooks Signed-off-by: David Horstmann <david.horstmann@arm.com>