+
+
+def _main() -> None:
+ if len(sys.argv) == 3:
+ print('{1} {0}'.format(*fetch(Repo(sys.argv[1]), Ref(sys.argv[2]))))
+ elif len(sys.argv) == 4:
+ print(ensure_rev_available(
+ Repo(sys.argv[1]), Ref(sys.argv[2]), Rev(sys.argv[3])))
+ else:
+ usage = '''usage: git-cache repo ref [rev]
+example: git-cache https://github.com/NixOS/nixpkgs.git master'''
+ print(usage, file=sys.stderr)
+ sys.exit(1)