From a90e5ebde43fe22e91ef934151d251b13bef6beb Mon Sep 17 00:00:00 2001 From: Alex Thiessen Date: Sun, 14 Jan 2018 10:38:30 +0000 Subject: Makefile.inc: Improve git worktree check `Makefile.inc` checks for `.git` to be present under $(top) to define the value of $GIT. This check is rather weak and doesn't handle many edge cases like that of a broken gitfile. Add a proper `git rev-parse` call to check the condition. Change-Id: Ifd6da19f13d9f2a9fddb6afd7cb5f16daba2401e Signed-off-by: Alex Thiessen Reviewed-on: https://review.coreboot.org/23254 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- Makefile.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 4ce74745a9..f91e8d4297 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -14,7 +14,8 @@ ## ifneq ($(NOCOMPILE),1) -GIT:=$(shell [ -e "$(top)/.git" ] && command -v git) +GIT:=$(shell git -C "$(top)" rev-parse --git-dir 1>/dev/null 2>&1 \ + && command -v git) else GIT:= endif -- cgit v1.2.3