Skip to content

Commit 602acb2

Browse files
author
Samuli Piippo
committed
Check git hash/tag only if we are in git repo
Checking for git hash and tag from released source package causes confusing "fatal" warning messages. Now do it only if we are in a git repo. Task-number: QTEE-338 Change-Id: I6269b22fd774f218cd9a219a4f2519d73bf13358 Reviewed-by: Rainer Keller <[email protected]>
1 parent c0ee8a8 commit 602acb2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

appcontroller.pro

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ android {
1717
INSTALLS+=target
1818

1919
# Find out git hash
20-
unix:system(which git):HAS_GIT=TRUE
21-
win32:system(where git.exe):HAS_GIT=TRUE
22-
contains(HAS_GIT, TRUE) {
23-
GIT_HASH=$$system(git log -1 --format=%H)
24-
!system(git diff-index --quiet HEAD): GIT_HASH="$$GIT_HASH-dirty"
25-
GIT_VERSION=$$system(git describe --tags --exact-match)
26-
isEmpty(GIT_VERSION) : GIT_VERSION="unknown"
20+
exists(.git) {
21+
unix:system(which git):HAS_GIT=TRUE
22+
win32:system(where git.exe):HAS_GIT=TRUE
23+
contains(HAS_GIT, TRUE) {
24+
GIT_HASH=$$system(git log -1 --format=%H)
25+
!system(git diff-index --quiet HEAD): GIT_HASH="$$GIT_HASH-dirty"
26+
GIT_VERSION=$$system(git describe --tags --exact-match)
27+
isEmpty(GIT_VERSION) : GIT_VERSION="unknown"
28+
}
2729
} else {
2830
GIT_HASH="unknown"
2931
GIT_VERSION="unknown"

0 commit comments

Comments
 (0)