repo: add support for reading standalone manifests from disk

BUG=b:192664812
TEST=existing tests (no coverage), manual runs

Change-Id: Ic032417ecfca77d5e0de1b1ff62b30ce8205bfc5
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318715
Tested-by: Jack Neus <jackneus@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Jack Neus 2021-09-23 13:59:58 +00:00
parent c474c9cba1
commit 7a1e7e772f

View File

@ -35,4 +35,7 @@ def fetch_file(url):
print('fatal: error running "gsutil": %s' % e.output,
file=sys.stderr)
sys.exit(1)
if scheme == 'file':
with open(url[len('file://'):], 'rb') as f:
return f.read()
raise ValueError('unsupported url %s' % url)