api: allow rev on local repos

This commit is contained in:
Alexander Schepanovski
2020-01-19 21:38:30 +07:00
parent 033ef88a4e
commit 9de0643d97
+1 -1
View File
@@ -109,7 +109,7 @@ def read(path, repo=None, rev=None, remote=None, mode="r", encoding=None):
@contextmanager
def _make_repo(repo_url, rev=None):
if not repo_url or os.path.exists(repo_url):
if rev is None and (not repo_url or os.path.exists(repo_url)):
yield Repo(repo_url)
else:
with external_repo(url=repo_url, rev=rev) as repo: