Makefile: Allow use of a specific hash for module using a git repo

`git reset --hard <commit_hash>` is a no-op when commit_hash is unset
This commit is contained in:
Matt DeVillier 2021-03-25 11:56:22 -05:00 committed by Sergii Dmytruk
parent 9df4e48ff2
commit 00bb2b6c32
No known key found for this signature in database
GPG Key ID: 48579AA47429663E

View File

@ -258,7 +258,7 @@ define define_module =
# this case, since we don't have a stable version to compare against.
$(build)/$($1_base_dir)/.canary:
git clone $($1_repo) "$(build)/$($1_base_dir)"
cd $(build)/$($1_base_dir) && git submodule update --init --checkout
cd $(build)/$($1_base_dir) && git reset --hard $($1_commit_hash) && git submodule update --init --checkout
if [ -r patches/$($1_patch_name).patch ]; then \
( cd $(build)/$($1_base_dir) ; patch -p1 ) \
< patches/$($1_patch_name).patch \