summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@digia.com>2014-02-17 10:07:29 +0200
committerSamuli Piippo <samuli.piippo@digia.com>2014-02-17 11:37:43 +0200
commit602acb292c76e01e00382d14d387ea2ec367927c (patch)
treea476cd83aaf6cbe4149f2b2aa0ceebaaa88bb586
parentc0ee8a8d2b2b88da7091ccb5042617b9378bd2be (diff)
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 <rainer.keller@digia.com>
-rw-r--r--appcontroller.pro16
1 files changed, 9 insertions, 7 deletions
diff --git a/appcontroller.pro b/appcontroller.pro
index ac7eb83..b467652 100644
--- a/appcontroller.pro
+++ b/appcontroller.pro
@@ -17,13 +17,15 @@ android {
INSTALLS+=target
# Find out git hash
-unix:system(which git):HAS_GIT=TRUE
-win32:system(where git.exe):HAS_GIT=TRUE
-contains(HAS_GIT, TRUE) {
- GIT_HASH=$$system(git log -1 --format=%H)
- !system(git diff-index --quiet HEAD): GIT_HASH="$$GIT_HASH-dirty"
- GIT_VERSION=$$system(git describe --tags --exact-match)
- isEmpty(GIT_VERSION) : GIT_VERSION="unknown"
+exists(.git) {
+ unix:system(which git):HAS_GIT=TRUE
+ win32:system(where git.exe):HAS_GIT=TRUE
+ contains(HAS_GIT, TRUE) {
+ GIT_HASH=$$system(git log -1 --format=%H)
+ !system(git diff-index --quiet HEAD): GIT_HASH="$$GIT_HASH-dirty"
+ GIT_VERSION=$$system(git describe --tags --exact-match)
+ isEmpty(GIT_VERSION) : GIT_VERSION="unknown"
+ }
} else {
GIT_HASH="unknown"
GIT_VERSION="unknown"