import os
import subprocess
+from git_remote_helpers.util import check_call
+
+
def sanitize(rev, sep='\t'):
"""Converts a for-each-ref line to a name/value pair.
"""
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.
path = ".cached_revs"
ofile = open(path, "w")
- subprocess.check_call(args, stdout=ofile)
+ check_call(args, stdout=ofile)
output = open(path).readlines()
self.revmap = dict(sanitize(i) for i in output)
if "HEAD" in self.revmap: