Sergii Dmytruk has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84292?usp=email )
Change subject: payloads/edk2/Makefile: detect invalid commit hash on checkout ......................................................................
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 --- M payloads/external/edk2/Makefile 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/84292/1
diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile index e198623..6464e9f 100644 --- a/payloads/external/edk2/Makefile +++ b/payloads/external/edk2/Makefile @@ -179,7 +179,7 @@ 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 @@ 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; \