Skip to content

Commit

Permalink
Fudge the environment passed to git
Browse files Browse the repository at this point in the history
Change-Id: I7b1e4f2d9c747f4560745a1d1cad65317182a63b
  • Loading branch information
jrha committed Jul 26, 2018
1 parent c0066e8 commit 9b9af10
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/broker/brokertest.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ def gitenv(cls, env=None):
# Some reasonable defaults...
path = ["/bin", "/usr/bin"]

# Allow tests running in a CI environment (e.g. travis) to find local git config
if "HOME" not in newenv:
newenv["HOME"] = os.environ.get("HOME", "/home/%(USER)s" % newenv)

# The 'aq' command need to run some external tools, so make sure those
# will be found
for exe in [sys.executable,
Expand All @@ -608,6 +612,7 @@ def gitcommand_raw(self, command, **kwargs):
args = [command]
args.insert(0, self.config.lookup_tool("git"))
env = self.gitenv(kwargs.pop("env", None))

p = Popen(args, stdout=PIPE, stderr=PIPE, env=env, **kwargs)
return p

Expand Down

0 comments on commit 9b9af10

Please sign in to comment.