From 5f4a5aecb2535a529832e27cefa6371f28857878 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Iv=C3=A1n=20Briano?= <ivan.briano@intel.com>
Date: Thu, 13 Aug 2015 14:11:23 -0300
Subject: [PATCH] make: Get the git directory from RIOTBASE

This allows having applications outside of RIOT's own git directory and
still get the correct branch information for the build.
---
 Makefile.include | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.include b/Makefile.include
index 59b709af41..250ef84dd1 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -167,9 +167,9 @@ include $(RIOTBASE)/Makefile.cflags
 
 # make the RIOT version available to the program
 ifeq ($(origin RIOT_VERSION), undefined)
-  GIT_STRING := $(shell git describe --always --abbrev=4 --dirty=-`hostname` 2> /dev/null)
+  GIT_STRING := $(shell git --git-dir="$(RIOTBASE)/.git" describe --always --abbrev=4 --dirty=-`hostname` 2> /dev/null)
   ifneq (,$(GIT_STRING))
-    GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
+    GIT_BRANCH := $(shell git --git-dir="$(RIOTBASE)/.git" rev-parse --abbrev-ref HEAD)
     ifeq ($(strip $(GIT_BRANCH)),master)
       RIOT_VERSION := $(GIT_STRING)
     else
-- 
GitLab