Skip to content

Handle non-UTF-8 names in packed refs#2190

Open
pick7 wants to merge 1 commit into
gitpython-developers:mainfrom
pick7:codex/packed-refs-surrogateescape
Open

Handle non-UTF-8 names in packed refs#2190
pick7 wants to merge 1 commit into
gitpython-developers:mainfrom
pick7:codex/packed-refs-surrogateescape

Conversation

@pick7

@pick7 pick7 commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • Read packed-refs with Python surrogateescape handling.
  • Preserve undecodable ref-name bytes instead of failing during decoding.
  • Add a repo.tags regression test using a non-UTF-8 tag name.

Fixes #2064.

Validation

  • GIT_PYTHON_TEST_GIT_REPO_BASE=/tmp/gitpython-test-fixture.i7gtuO .venv/bin/python -m pytest -o addopts= test/test_refs.py
  • .venv/bin/python -m ruff check git/refs/symbolic.py test/test_refs.py
  • .venv/bin/python -m ruff format --check git/refs/symbolic.py test/test_refs.py
  • .venv/bin/python -m mypy git/refs/symbolic.py

AI agent disclosure

This pull request was prepared and submitted by OpenAI Codex acting as an AI agent through the contributor account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Encoding issue with tags in packed-refs file

1 participant