From 067f150b75c41e2238c783bd24b3e2a14d613252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=B6hler?= Date: Tue, 28 Jan 2025 12:01:19 +0100 Subject: [PATCH] fpga: tools: mark hash dirty with staged changes Original-commit: d635ee91fb34fa1fbb0c70a23337f4ea5a05cc1f --- tools/scripts/git-hash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/scripts/git-hash.sh b/tools/scripts/git-hash.sh index ed8d796..74e4063 100755 --- a/tools/scripts/git-hash.sh +++ b/tools/scripts/git-hash.sh @@ -43,7 +43,7 @@ if [[ $write -eq 0 ]]; then short_hash="$(git rev-parse --verify HEAD --short=7 2>/dev/null)" && git_success=1 if [[ $git_success -eq 1 ]]; then # Check if tree is clean. If yes, the top 4 bits are 0 - if (git diff --quiet 2>/dev/null); then + if [[ -z $(git status --porcelain --untracked-files=no 2>/dev/null) ]]; then ettus_githash32="0$short_hash" else ettus_githash32="f$short_hash" @@ -64,7 +64,7 @@ else # Get hash from git short_hash="$(git rev-parse --verify HEAD --short=7 2>/dev/null)" || { echo "ERROR: Not a git tree"; exit 2; } # Check if tree is clean. If yes, the top 4 bits are 0 - if (git diff --quiet 2>/dev/null); then + if [[ -z $(git status --porcelain --untracked-files=no 2>/dev/null) ]]; then ettus_githash32="0$short_hash" else ettus_githash32="f$short_hash"