]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git_remote_helpers/git/repo.py
Merge branch 'jn/grep-open'
[thirdparty/git.git] / git_remote_helpers / git / repo.py
index 82d5f78c7eeb3eef7e307d654b424b4c831bf2ba..58e1cdb560fa0fe1a4745f971064e5e967408502 100644 (file)
@@ -19,7 +19,10 @@ def is_remote(url):
 
     prefixes = ["http", "file", "git"]
 
-    return any(url.startswith(i) for i in prefixes)
+    for prefix in prefixes:
+        if url.startswith(prefix):
+            return True
+    return False
 
 class GitRepo(object):
     """Repo object representing a repo.
@@ -50,7 +53,9 @@ class GitRepo(object):
         path = ".cached_revs"
         ofile = open(path, "w")
 
-        subprocess.check_call(args, stdout=ofile)
+        child = subprocess.Popen(args, stdout=ofile)
+        if child.wait() != 0:
+            raise CalledProcessError
         output = open(path).readlines()
         self.revmap = dict(sanitize(i) for i in output)
         if "HEAD" in self.revmap: