diff --git a/git_cache.py b/git_cache.py index 772dbea12..02a09beaa 100755 --- a/git_cache.py +++ b/git_cache.py @@ -552,14 +552,6 @@ class Mirror(object): spec = spec.decode() try: self.print('Fetching %s' % spec) - env = os.environ.copy() - env.update({ - 'GIT_TRACE_PACKET': '1', - 'GIT_TR2_EVENT': '1', - 'GIT_TRACE2_EVENT': '1', - 'GIT_TRACE_CURL': '1', - 'GIT_TRACE_CURL_NO_DATA': '1' - }) # Only print first 30000 packets. We can use nonlocal keyword once we # switch to python 3. packet_count = [0] @@ -578,7 +570,6 @@ class Mirror(object): fetch_cmd + [spec], cwd=rundir, retry=True, - env=env, filter_fn=FilterPacket) except subprocess.CalledProcessError: if spec == '+refs/heads/*:refs/heads/*': diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index b1d1fb854..32ae948fe 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -666,6 +666,11 @@ def _git_checkout(sln, sln_dir, revisions, refs, git_cache_dir, cleanup_dir): env = { 'GIT_TRACE': 'true', 'GIT_TRACE_PERFORMANCE': 'true', + 'GIT_TRACE_PACKET': '1', + 'GIT_TRACE2_EVENT': '1', + 'GIT_TRACE_CURL': '1', + 'GIT_TRACE_CURL_NO_DATA': '1', + 'INFRA_GIT_WRAPPER_TRACE': '1', } # Step 1: populate/refresh cache, if necessary. @@ -723,11 +728,11 @@ def _git_checkout(sln, sln_dir, revisions, refs, git_cache_dir, cleanup_dir): else: _git_disable_gc(sln_dir) git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir) - git('fetch', 'origin', cwd=sln_dir) + git('fetch', 'origin', cwd=sln_dir, env=env) git('remote', 'set-url', '--push', 'origin', url, cwd=sln_dir) for ref in refs: refspec = '%s:%s' % (ref, ref.lstrip('+')) - git('fetch', 'origin', refspec, cwd=sln_dir) + git('fetch', 'origin', refspec, cwd=sln_dir, env=env) # Windows sometimes has trouble deleting files. # This can make git commands that rely on locks fail.