Commit 8908c30
packfile: disentangle return value of
The `packed_object_info()` function returns the type of the packed
object. While we use an `enum object_type` to store the return value,
this type is not to be confused with the actual object type. It _may_
contain the object type, but it may just as well encode that the given
packed object is stored as a delta.
We have removed the only caller that relied on this returned object type
in the preceding commit, so let's simplify semantics and return either 0
on success or a negative error code otherwise.
This unblocks a small optimization where we can skip reading the object
type altogether.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>packed_object_info()
1 parent 57c168d commit 8908c30
2 files changed
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1587 | 1587 | | |
1588 | 1588 | | |
1589 | 1589 | | |
| 1590 | + | |
1590 | 1591 | | |
1591 | 1592 | | |
1592 | 1593 | | |
| |||
1607 | 1608 | | |
1608 | 1609 | | |
1609 | 1610 | | |
1610 | | - | |
| 1611 | + | |
1611 | 1612 | | |
1612 | 1613 | | |
1613 | 1614 | | |
1614 | 1615 | | |
1615 | | - | |
| 1616 | + | |
1616 | 1617 | | |
1617 | 1618 | | |
1618 | 1619 | | |
| |||
1625 | 1626 | | |
1626 | 1627 | | |
1627 | 1628 | | |
1628 | | - | |
| 1629 | + | |
1629 | 1630 | | |
1630 | 1631 | | |
1631 | 1632 | | |
| |||
1639 | 1640 | | |
1640 | 1641 | | |
1641 | 1642 | | |
1642 | | - | |
| 1643 | + | |
1643 | 1644 | | |
1644 | 1645 | | |
1645 | 1646 | | |
| |||
1649 | 1650 | | |
1650 | 1651 | | |
1651 | 1652 | | |
1652 | | - | |
| 1653 | + | |
1653 | 1654 | | |
1654 | 1655 | | |
1655 | 1656 | | |
| |||
1672 | 1673 | | |
1673 | 1674 | | |
1674 | 1675 | | |
| 1676 | + | |
| 1677 | + | |
1675 | 1678 | | |
1676 | 1679 | | |
1677 | | - | |
| 1680 | + | |
1678 | 1681 | | |
1679 | 1682 | | |
1680 | 1683 | | |
| |||
2152 | 2155 | | |
2153 | 2156 | | |
2154 | 2157 | | |
2155 | | - | |
| 2158 | + | |
2156 | 2159 | | |
2157 | 2160 | | |
2158 | 2161 | | |
| |||
2164 | 2167 | | |
2165 | 2168 | | |
2166 | 2169 | | |
2167 | | - | |
2168 | | - | |
| 2170 | + | |
| 2171 | + | |
2169 | 2172 | | |
2170 | 2173 | | |
2171 | 2174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
381 | 385 | | |
382 | 386 | | |
383 | 387 | | |
| |||
0 commit comments