From b26170aabcc5c78ab90883ceaf27164e594395d8 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 1 Oct 2018 15:26:04 -0400 Subject: [PATCH] Fix browsing by tags --- gitsrht/blueprints/repo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 511272d..0e0fe08 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -101,7 +101,7 @@ def tree(owner, repo, ref, path): git_repo = CachedRepository(repo.path) ref = ref or git_repo.default_branch().name[len("refs/heads/"):] commit = git_repo.revparse_single(ref) - if commit is pygit2.Tag: + if isinstance(commit, pygit2.Tag): commit = git_repo.get(commit.target) tree = commit.tree @@ -147,7 +147,7 @@ def raw_blob(owner, repo, ref, path): git_repo = CachedRepository(repo.path) ref = ref or git_repo.default_branch().name[len("refs/heads/"):] commit = git_repo.revparse_single(ref) - if commit is pygit2.Tag: + if isinstance(commit, pygit2.Tag): commit = git_repo.get(commit.target) blob = None @@ -183,7 +183,7 @@ def archive(owner, repo, ref): git_repo = CachedRepository(repo.path) ref = ref or git_repo.default_branch().name[len("refs/heads/"):] commit = git_repo.revparse_single(ref) - if commit is pygit2.Tag: + if isinstance(commit, pygit2.Tag): commit = git_repo.get(commit.target) path = f"/tmp/{commit.id.hex}.tar.gz" @@ -262,7 +262,7 @@ def log(owner, repo, ref, path): git_repo = CachedRepository(repo.path) ref = ref or git_repo.default_branch().name[len("refs/heads/"):] commit = git_repo.revparse_single(ref) - if commit is pygit2.Tag: + if isinstance(commit, pygit2.Tag): commit = git_repo.get(commit.target) refs = collect_refs(git_repo) @@ -290,7 +290,7 @@ def commit(owner, repo, ref): abort(401) git_repo = CachedRepository(repo.path) commit = git_repo.revparse_single(ref) - if commit is pygit2.Tag: + if isinstance(commit, pygit2.Tag): ref = git_repo.get(commit.target) try: parent = git_repo.revparse_single(ref + "^") -- 2.38.4