Repository navigation
Commit 18c31aa
fix(refs): resolve locally tracked branches through Git
angr 10.0.4.post1's repository report cannot describe a branch configured to
track another local branch. `Head.tracking_branch()` treats Git's special
`branch.<name>.remote=.` value as a remote name and constructs the nonexistent
`refs/remotes/./<branch>` reference. The helper prints a generic tracking error
instead of its intended local-branch message. Released GitPython 3.2.1 exhibits
the same bug; a valid local-upstream fixture reproduces it independently.
For the local-repository selector, ask `git rev-parse --symbolic-full-name
<branch>@{upstream}` to resolve the configured location and return a `Head` for
that result. Keep existing remote-reference behavior for ordinary remote
tracking. Update the annotated return type and documentation for local heads.
This delegates Git configuration and upstream validation to Git rather than
reconstructing their semantics in Python. GixPython does not expose this resolver,
so the operation retains an explicit documented CLI fallback.
Add a Bash fixture and regressions across SHA-1/SHA-256 and files/reftable
storage. All four cases fail before the correction. The full reference suite
and downstream regressions pass 61 tests and 24 subtests on each backend, CLI
first. All five unchanged angr supplemental tests now pass on both backends;
the initial and released baseline failures are retained in the audit evidence.
Ruff lint/format, ShellCheck for the fixture, mypy for `git/refs/head.py` and
`git diff --check` pass with Python 3.12.15, Git 2.53.0 and GixPython 0.2.0.1 parent 3c58d29 commit 18c31aa
5 files changed
Lines changed: 45 additions & 3 deletions
File tree
- doc
- source
- git/refs
- tests/fixtures
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
58 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
| 208 | + | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
215 | 222 | | |
216 | 223 | | |
217 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments