~sircmpwn/sr.ht-dev

git.sr.ht: blueprints/repo: Fix more pygit2 regressions v2 APPLIED

Thorben Günther: 1
 blueprints/repo: Fix more pygit2 regressions

 1 files changed, 3 insertions(+), 3 deletions(-)
#1284067 alpine.yml failed
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/54065/mbox | git am -3
Learn more about email & git

[PATCH git.sr.ht v2] blueprints/repo: Fix more pygit2 regressions Export this patch

Otherwise this will happen:
  File "/usr/lib/python3.12/site-packages/gitsrht/blueprints/repo.py", line 148, in summary
    tags = [(ref, git_repo.get(git_repo.references[ref].raw_target))
                               ~~~~~~~~~~~~~~~~~~~^^^^^
  File "/usr/lib/python3.12/site-packages/pygit2/references.py", line 41, in __getitem__
    return self._repository.lookup_reference(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: bad argument type for built-in operation
---
v2: Add one more case

 gitsrht/blueprints/repo.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py
index f1785cf..8d5b2c3 100644
--- a/gitsrht/blueprints/repo.py
+++ b/gitsrht/blueprints/repo.py
@@ -145,7 +145,7 @@ def summary(owner, repo):
            ref=f"{default_branch_name}/", path="")  # Trailing slash needed
        readme = get_readme(repo, git_repo, tip,
            link_prefix=[link_prefix, blob_prefix])
        tags = [(ref, git_repo.get(git_repo.references[ref].raw_target))
        tags = [(ref, git_repo.get(git_repo.references[ref.decode('utf-8')].raw_target))
            for ref in git_repo.raw_listall_references()
            if ref.startswith(b"refs/tags/")]
        tags = [tag for tag in tags
@@ -632,7 +632,7 @@ def refs(owner, repo):

        tags = [(
                ref,
                git_repo.get(git_repo.references[ref].target),
                git_repo.get(git_repo.references[ref.decode('utf-8')].target),
                lookup_signature(git_repo, ref.decode('utf-8'))[1]
            ) for ref in git_repo.raw_listall_references()
              if ref.startswith(b"refs/tags/")]
@@ -717,7 +717,7 @@ def refs_rss(owner, repo):
    owner, repo = get_repo_or_redir(owner, repo)
    with GitRepository(repo.path) as git_repo:
        references = [
            git_repo.references[name]
            git_repo.references[name.decode('utf-8')]
            for name in git_repo.raw_listall_references()
            if name.startswith(b"refs/tags/")
        ]

base-commit: 5b0db6112d69c30c8dbabf2fb6214cefd93240e6
--
2.45.2
Thanks!

to git@git.sr.ht:~sircmpwn/git.sr.ht
  5b0db61..9722a22  master -> master
git.sr.ht/patches/alpine.yml: FAILED in 1m19s

[blueprints/repo: Fix more pygit2 regressions][0] v2 from [Thorben Günther][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/54065
[1]: mailto:admin@xenrox.net

✗ #1284067 FAILED git.sr.ht/patches/alpine.yml https://builds.sr.ht/~sircmpwn/job/1284067