Commit 18f1ad7
handle_revision_arg: record paths for pending objects
If the revision parser sees an argument like tree:path, we
parse it down to the correct blob (or tree), but throw away
the "path" portion. Let's ask get_sha1_with_context() to
record it, and pass it along in the pending array.
This will let programs like git-diff which rely on the
revision-parser show more accurate paths.
Note that the implementation is a little tricky; we have to
make sure we free oc.path in all code paths. For handle_dotdot(),
we can piggy-back on the existing cleanup-wrapper pattern.
The real work happens in handle_dotdot_1(), but the
handle_dotdot() wrapper makes sure that the path is freed no
matter how we exit the function (and for that reason we make
sure that the object_context struct is zero'd, so if we fail
to even get to the get_sha1_with_context() call, we just end
up calling free(NULL)).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 101dd4d commit 18f1ad7
1 file changed
Lines changed: 21 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1443 | 1443 | | |
1444 | 1444 | | |
1445 | 1445 | | |
1446 | | - | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
1447 | 1449 | | |
1448 | 1450 | | |
1449 | 1451 | | |
1450 | 1452 | | |
1451 | | - | |
1452 | 1453 | | |
1453 | 1454 | | |
1454 | 1455 | | |
1455 | | - | |
| 1456 | + | |
1456 | 1457 | | |
1457 | 1458 | | |
1458 | 1459 | | |
| |||
1466 | 1467 | | |
1467 | 1468 | | |
1468 | 1469 | | |
1469 | | - | |
1470 | | - | |
| 1470 | + | |
| 1471 | + | |
1471 | 1472 | | |
1472 | 1473 | | |
1473 | 1474 | | |
| |||
1509 | 1510 | | |
1510 | 1511 | | |
1511 | 1512 | | |
1512 | | - | |
1513 | | - | |
| 1513 | + | |
| 1514 | + | |
1514 | 1515 | | |
1515 | 1516 | | |
1516 | 1517 | | |
1517 | 1518 | | |
1518 | 1519 | | |
1519 | 1520 | | |
1520 | 1521 | | |
| 1522 | + | |
1521 | 1523 | | |
1522 | 1524 | | |
1523 | 1525 | | |
1524 | 1526 | | |
1525 | 1527 | | |
1526 | 1528 | | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
1527 | 1532 | | |
1528 | | - | |
| 1533 | + | |
| 1534 | + | |
1529 | 1535 | | |
1530 | 1536 | | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
1531 | 1540 | | |
1532 | 1541 | | |
1533 | 1542 | | |
| |||
1540 | 1549 | | |
1541 | 1550 | | |
1542 | 1551 | | |
1543 | | - | |
| 1552 | + | |
1544 | 1553 | | |
1545 | 1554 | | |
1546 | 1555 | | |
| |||
1591 | 1600 | | |
1592 | 1601 | | |
1593 | 1602 | | |
1594 | | - | |
| 1603 | + | |
1595 | 1604 | | |
1596 | 1605 | | |
1597 | 1606 | | |
1598 | 1607 | | |
1599 | 1608 | | |
1600 | 1609 | | |
1601 | 1610 | | |
1602 | | - | |
| 1611 | + | |
| 1612 | + | |
1603 | 1613 | | |
1604 | 1614 | | |
1605 | 1615 | | |
| |||
0 commit comments