Skip to content

Commit ed1fcdc

Browse files
committed
Bugfix: Detect genbuild.sh in repo correctly
1 parent df63490 commit ed1fcdc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

share/genbuild.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ else
1313
exit 1
1414
fi
1515

16+
git_check_in_repo() {
17+
! { git status --porcelain -uall --ignored "$@" 2>/dev/null || echo '??'; } | grep -q '?'
18+
}
19+
1620
DESC=""
1721
SUFFIX=""
18-
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
22+
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
1923
# clean 'dirty' status of touched files that haven't been modified
2024
git diff >/dev/null 2>/dev/null
2125

0 commit comments

Comments
 (0)