Repository navigation
Commit b84749b
committed
fix(repo): preserve timezone metadata in blame results
During a review of Git metadata APIs for development tools, I found that blame results for working-tree changes could not be read through the ordinary datetime properties.
Both parsers already retain the actor identities and timestamps, but omit the timezone fields. This makes `authored_datetime` and `committed_datetime` try to load the zero object for uncommitted lines, raising `BadObject`. Parse the offsets reported by Git with the existing `utctz_to_altz` helper and provide them to `Commit`. The ordinary parser preserves its optional-field fallback. This is shared porcelain parsing; blame remains a Git CLI fallback in Gix mode.
The shell fixture creates a fresh repository with different author and committer offsets and an uncommitted line. Its four subcases fail on the original source and pass with this change. On Windows CPython3.13.5, the complete non-network `test_repo.py` and `test_commit.py` suites each pass with175 tests and68 subtests under both CLI and Gix selections, with8 skips and1 expected failure per run. Ruff, mypy, basedpyright, ShellCheck and applicable file checks pass. Independent review covers six additional API combinations and24 entries. The full repository, network, other platform/interpreter and documentation matrices were not run.
Assisted-by: OpenAI Codex
Agent-Model: GPT-61 parent 23f33ef commit b84749b
3 files changed
Lines changed: 46 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
1363 | 1364 | | |
1364 | 1365 | | |
1365 | 1366 | | |
| 1367 | + | |
1366 | 1368 | | |
1367 | 1369 | | |
1368 | 1370 | | |
1369 | 1371 | | |
1370 | 1372 | | |
| 1373 | + | |
1371 | 1374 | | |
1372 | 1375 | | |
1373 | 1376 | | |
| |||
1452 | 1455 | | |
1453 | 1456 | | |
1454 | 1457 | | |
| 1458 | + | |
1455 | 1459 | | |
1456 | 1460 | | |
1457 | 1461 | | |
| 1462 | + | |
1458 | 1463 | | |
1459 | 1464 | | |
1460 | 1465 | | |
| |||
1504 | 1509 | | |
1505 | 1510 | | |
1506 | 1511 | | |
1507 | | - | |
| 1512 | + | |
1508 | 1513 | | |
1509 | 1514 | | |
1510 | 1515 | | |
1511 | 1516 | | |
1512 | 1517 | | |
1513 | 1518 | | |
| 1519 | + | |
| 1520 | + | |
1514 | 1521 | | |
1515 | 1522 | | |
1516 | 1523 | | |
1517 | 1524 | | |
1518 | 1525 | | |
1519 | 1526 | | |
1520 | 1527 | | |
| 1528 | + | |
| 1529 | + | |
1521 | 1530 | | |
1522 | 1531 | | |
1523 | 1532 | | |
| |||
1540 | 1549 | | |
1541 | 1550 | | |
1542 | 1551 | | |
| 1552 | + | |
1543 | 1553 | | |
1544 | 1554 | | |
| 1555 | + | |
1545 | 1556 | | |
1546 | 1557 | | |
1547 | 1558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
776 | 800 | | |
777 | 801 | | |
778 | 802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments