[coreboot-gerrit] Change in coreboot[master]: Makefile.inc: Improve git worktree check

Alex Thiessen (Code Review) gerrit at coreboot.org
Sun Jan 14 12:05:44 CET 2018


Alex Thiessen has uploaded this change for review. ( https://review.coreboot.org/23254


Change subject: Makefile.inc: Improve git worktree check
......................................................................

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 <alex.thiessen+coreboot at gmail.com>
---
M Makefile.inc
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/23254/1

diff --git a/Makefile.inc b/Makefile.inc
index 413f7ad..6bc51f8 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

-- 
To view, visit https://review.coreboot.org/23254
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd6da19f13d9f2a9fddb6afd7cb5f16daba2401e
Gerrit-Change-Number: 23254
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Thiessen <alex.thiessen.de+coreboot at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180114/07197b7f/attachment-0001.html>


More information about the coreboot-gerrit mailing list