diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-01 15:26:04 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-10-01 15:26:04 -0400 |
commit | b26170aabcc5c78ab90883ceaf27164e594395d8 (patch) | |
tree | dac4904508b1a026024129882802ad83fe5dc447 /gitsrht/blueprints | |
parent | 330fc074373deb7f81c84b1113ac48e61276c7b7 (diff) |
Fix browsing by tags
Diffstat (limited to 'gitsrht/blueprints')
-rw-r--r-- | gitsrht/blueprints/repo.py | 10 |
1 files 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 + "^") |