Fix API path of `Repository.get_git_ref` (#2992)
Rationale:
> 1. Note that PyGithub queries "git/refs/..." in the API.
> 2. After back and forth with Github support, we found out that
"git/refs/...." is internally pointing to the "List matching references"
API call. -
https://docs.github.com/en/enterprise-server@3.11/rest/git/refs?apiVersion=2022-11-28#list-matching-references
- Whereas the "Get a ref" call is strictly limited to 'git/ref/...'
(Note the missing S).
However, PyGitHub uses it in the get_git_ref method.
This has caused a bug in my application where calling
`Repository.get_git_ref("foo")` would return me any reference matching
`foo` - probably as prefix - , rather the one and only reference `foo`.
---------
Co-authored-by: Enrico Minack <github@enrico.minack.dev> C
Cristiano Salerno committed
a6965031e14f87b04b0e8a233e1348994720e23c
Parent: 1942645
Committed by GitHub <noreply@github.com>
on 8/14/2025, 8:14:38 PM