Title: Fix type hint for `SymbolicReference.reference` property by emmanuel-ferdman · Pull Request #2074 · gitpython-developers/GitPython · GitHub
Open Graph Title: Fix type hint for `SymbolicReference.reference` property by emmanuel-ferdman · Pull Request #2074 · gitpython-developers/GitPython
X Title: Fix type hint for `SymbolicReference.reference` property by emmanuel-ferdman · Pull Request #2074 · gitpython-developers/GitPython
Description: PR Summary This PR fixes mypy errors introduced in v3.1.45 where code like repo.head.ref.checkout() fails type checking even though it works at runtime. The issue is that SymbolicReference.reference was typed to return SymbolicReference, but it actually returns Reference subclasses that have methods like checkout() and tracking_branch(). Changed the return type annotation from SymbolicReference to Reference and added an explicit cast in _get_reference() to match what actually happens at runtime. This is a type-only change with no behavioral impact. Fixes #2066.
Open Graph Description: PR Summary This PR fixes mypy errors introduced in v3.1.45 where code like repo.head.ref.checkout() fails type checking even though it works at runtime. The issue is that SymbolicReference.referenc...
X Description: PR Summary This PR fixes mypy errors introduced in v3.1.45 where code like repo.head.ref.checkout() fails type checking even though it works at runtime. The issue is that SymbolicReference.referenc...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2074
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:94a507e1-f7e8-dfce-ca2f-067d754586d8 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A91C:9445B:C384F6:10F5EE3:696A8AEF |
| html-safe-nonce | ef5b0339ba8b6f992acbd94ba23677a93095cb4a9bef4373bbeb5599e9322fd7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTFDOjk0NDVCOkMzODRGNjoxMEY1RUUzOjY5NkE4QUVGIiwidmlzaXRvcl9pZCI6IjM1NDE4MDE5MTQzNDY0MDg2ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 661806db28ac189f93c3e830f27453bf066fcf3d1b906f4d8b26f26f1770b6d3 |
| hovercard-subject-tag | pull_request:2874932480 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/2074/files |
| twitter:image | https://avatars.githubusercontent.com/u/35470921?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/35470921?s=400&v=4 |
| og:image:alt | PR Summary This PR fixes mypy errors introduced in v3.1.45 where code like repo.head.ref.checkout() fails type checking even though it works at runtime. The issue is that SymbolicReference.referenc... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d2aa6dedd7d97fa651b17c40401f2605f309df5ca5fb659bf0554cf34f1de825 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c1dbca8981c5e3d6a69bce2f1d289e732b86241d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width