summaryrefslogtreecommitdiff
path: root/src/buildstream/testing/_utils/site.py
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-05-31 12:13:26 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-06 14:33:59 +0000
commit09b0cf8a208c46440cdb4d59ef1388522f12857a (patch)
tree6dab6c64ac15465d20ef45a6ee3c562fc6e0baf9 /src/buildstream/testing/_utils/site.py
parent3660337905dada5ee6bd9419ff83b5a6819f6801 (diff)
downloadbuildstream-09b0cf8a208c46440cdb4d59ef1388522f12857a.tar.gz
test:utils/site: Consolidate Git environment variables in a single place
We have two different 'site' files that are redundant and both define some variables in BuildStream environment. Moving all the git related ones in a single place.
Diffstat (limited to 'src/buildstream/testing/_utils/site.py')
-rw-r--r--src/buildstream/testing/_utils/site.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buildstream/testing/_utils/site.py b/src/buildstream/testing/_utils/site.py
index 63689301e..dbb4b9769 100644
--- a/src/buildstream/testing/_utils/site.py
+++ b/src/buildstream/testing/_utils/site.py
@@ -2,6 +2,7 @@
# so we dont have to repeat this everywhere
#
import os
+import subprocess
import sys
import platform
@@ -11,6 +12,11 @@ from buildstream import _site, utils, ProgramNotFoundError
try:
GIT = utils.get_host_tool('git')
HAVE_GIT = True
+
+ out = str(subprocess.check_output(['git', '--version']), "utf-8")
+ version = tuple(int(x) for x in out.split(' ')[2].split('.'))
+ HAVE_OLD_GIT = version < (1, 8, 5)
+
GIT_ENV = {
'GIT_AUTHOR_DATE': '1320966000 +0200',
'GIT_AUTHOR_NAME': 'tomjon',
@@ -22,6 +28,7 @@ try:
except ProgramNotFoundError:
GIT = None
HAVE_GIT = False
+ HAVE_OLD_GIT = False
GIT_ENV = dict()
try: