diff options
author | Sergii Dmytruk <sergii.dmytruk@3mdeb.com> | 2024-09-10 15:38:55 +0300 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-09-12 14:57:27 +0000 |
commit | ffc48178de6eee2e4efd33b4943f922475badc71 (patch) | |
tree | 695ced54b8ea9eb2523fab5aa94453dfc55cede8 /payloads/external | |
parent | c6bd214055fe9dab028e1a8e98acbcf6bf61bbfd (diff) |
payloads/edk2/Makefile: detect invalid commit hash on checkout
There is already a check for invalid reference, however `git rev-parse
reference` doesn't fail on unknown commit hash unless `^{object}`
peeling operator is used (`^{commit}` can be used as well).
Change-Id: I7ef39aeee2e902ac2fad6ac41b546c47418e1dec
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84292
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Diffstat (limited to 'payloads/external')
-rw-r--r-- | payloads/external/edk2/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile index e1986239fc..6464e9f851 100644 --- a/payloads/external/edk2/Makefile +++ b/payloads/external/edk2/Makefile @@ -179,7 +179,7 @@ $(EDK2_PLATFORMS_PATH): $(WORKSPACE) git clone --recurse-submodules $(CONFIG_EDK2_PLATFORMS_REPOSITORY) $(EDK2_PLATFORMS_PATH) -j5; \ fi cd $(EDK2_PLATFORMS_PATH); \ - if ! git rev-parse --verify -q $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) >/dev/null; then \ + if ! git rev-parse --verify -q $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV)^{object} >/dev/null; then \ echo " $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) is not a valid git reference"; \ exit 1; \ fi; \ @@ -202,7 +202,7 @@ $(EDK2_PATH): $(WORKSPACE) fi; \ echo " Fetching new commits from $(CONFIG_EDK2_REPOSITORY)"; \ git fetch origin 2>/dev/null; \ - if ! git rev-parse --verify -q $(CONFIG_EDK2_TAG_OR_REV) >/dev/null; then \ + if ! git rev-parse --verify -q $(CONFIG_EDK2_TAG_OR_REV)^{object} >/dev/null; then \ echo " $(CONFIG_EDK2_TAG_OR_REV) is not a valid git reference"; \ exit 1; \ fi; \ |