Skip to content

Commit

Permalink
Call git fetch directly using subprocess.
Browse files Browse the repository at this point in the history
This makes it easier to inspect what's going on vs going via gitpython
  • Loading branch information
jgraham committed Oct 21, 2020
1 parent 7fb311a commit dea6ffe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sync/gitutils.py
@@ -1,4 +1,5 @@
from __future__ import absolute_import
import subprocess
import time

import git
Expand Down Expand Up @@ -62,16 +63,22 @@ def until(func, cond, max_tries=5):
return True


def _fetch(git_gecko, remote):
cmd = ["git", "--git-dir", git_gecko.git_dir, "fetch", remote]
logger.info(" ".join(cmd))
subprocess.check_call(cmd)


def _update_gecko(git_gecko):
# type: (Repo) -> None
with RepoLock(git_gecko):
logger.info("Fetching mozilla-unified")
# Not using the built in fetch() function since that tries to parse the output
# and sometimes fails
git_gecko.git.fetch("mozilla")
_fetch(git_gecko, "mozilla")
if "autoland" in [item.name for item in git_gecko.remotes]:
logger.info("Fetching autoland")
git_gecko.git.fetch("autoland")
_fetch(git_gecko, "autoland")


def _update_wpt(git_wpt):
Expand Down

0 comments on commit dea6ffe

Please sign in to comment.