aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2016-12-29 15:24:38 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2016-12-29 15:24:38 +0000
commited1fcdcac0b9388b4e50f5e4ca2d5cd963f1ef27 (patch)
treecc0ab03dd0bb69ddaaa87a384f4b463742f5271c
parentdf634908ba758232413c50e8f1f7a80d546d777b (diff)
Bugfix: Detect genbuild.sh in repo correctly
-rwxr-xr-xshare/genbuild.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/share/genbuild.sh b/share/genbuild.sh
index 2a7c5c888f..7db5455f63 100755
--- a/share/genbuild.sh
+++ b/share/genbuild.sh
@@ -13,9 +13,13 @@ else
exit 1
fi
+git_check_in_repo() {
+ ! { git status --porcelain -uall --ignored "$@" 2>/dev/null || echo '??'; } | grep -q '?'
+}
+
DESC=""
SUFFIX=""
-if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" -a -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" -a "$(git status --porcelain -u no --ignored "$0" | cut -b1)" != "?" ]; then
+if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" -a -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] && git_check_in_repo share/genbuild.sh; then
# clean 'dirty' status of touched files that haven't been modified
git diff >/dev/null 2>/dev/null