Bugfix: Detect genbuild.sh in repo correctly

(cherry picked from commit bitcoin/bitcoin@ed1fcdcac0)
This commit is contained in:
Luke Dashjr 2016-12-29 15:24:38 +00:00 committed by Jack Grigg
parent 8dbd2edd98
commit 7fa4df7e7a
1 changed files with 5 additions and 1 deletions

View File

@ -20,9 +20,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