diff mbox

[3/8] scripts/git_hash: fix bug where dirty was always set

Message ID 1446235949-22917-4-git-send-email-anders.roxell@linaro.org
State Superseded
Headers show

Commit Message

Anders Roxell Oct. 30, 2015, 8:12 p.m. UTC
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 scripts/git_hash.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
index e15094e..5e88763 100755
--- a/scripts/git_hash.sh
+++ b/scripts/git_hash.sh
@@ -9,7 +9,7 @@  ROOTDIR=${1}
 CUSTOM_STR=${CUSTOM_STR:-https://git.linaro.org/lng/odp.git}
 if [ -d ${ROOTDIR}/.git ]; then
 	hash=$(git --git-dir=${ROOTDIR}/.git describe | tr -d "\n")
-	if git --git-dir=${ROOTDIR}/.git diff-index --name-only HEAD &>/dev/null ; then
+	if [[ $(git --git-dir=${ROOTDIR}/.git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
 		dirty=-dirty
 	fi