From bad0b1fda232f7058112695fc63cbea5f278d142 Mon Sep 17 00:00:00 2001 From: Joshua Hesketh Date: Wed, 3 Jun 2015 23:01:30 +1000 Subject: Set env so git global has $HOME Currently setting git config fails because the env isn't complete. Change-Id: I95cabe87b9ad99cafb62b1f3595122f8f9c34649 --- turbo_hipster/lib/models.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py index b1cbbd2..c64bf63 100644 --- a/turbo_hipster/lib/models.py +++ b/turbo_hipster/lib/models.py @@ -303,7 +303,9 @@ class ShellTask(Task): if not os.path.exists(local_path): os.makedirs(local_path) + env = os.environ git_args = copy.deepcopy(job_args) + env.update(git_args) cmd = os.path.join( os.path.join(os.path.dirname(os.path.abspath(__file__)), @@ -319,15 +321,15 @@ class ShellTask(Task): while return_code != 0: tries += 1 return_code = utils.execute_to_log(cmd, self.git_prep_log, - env=git_args, cwd=local_path) - if tries >= 2: + env=env, cwd=local_path) + if tries == 2: # Try upping the post buffer. See: # http://stackoverflow.com/questions/6842687/ # the-remote-end-hung-up-unexpectedly-while-git-cloning utils.execute_to_log( "git config --global http.postBuffer 1048576000", - self.git_prep_log, env=git_args, cwd=local_path) - if tries >= 3: + self.git_prep_log, env=env, cwd=local_path) + if tries >= 4: break if return_code != 0: cmd = 'ifconfig' -- cgit v1.2.1