Commit 068f85e
sha1_file: introduce an nth_packed_object_oid function
There are places in the code where we would like to provide a struct
object_id *, yet read the hash directly from the pack. Provide an
nth_packed_object_oid function that is similar to the
nth_packed_object_sha1 function.
In order to avoid a potentially invalid cast, nth_packed_object_oid
provides a variable into which to store the value, which it returns on
success; on error, it returns NULL, as nth_packed_object_sha1 does.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 43bc3b6 commit 068f85e
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1608 | 1608 | | |
1609 | 1609 | | |
1610 | 1610 | | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
1611 | 1617 | | |
1612 | 1618 | | |
1613 | 1619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2628 | 2628 | | |
2629 | 2629 | | |
2630 | 2630 | | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
2631 | 2642 | | |
2632 | 2643 | | |
2633 | 2644 | | |
| |||
3788 | 3799 | | |
3789 | 3800 | | |
3790 | 3801 | | |
3791 | | - | |
| 3802 | + | |
3792 | 3803 | | |
3793 | | - | |
| 3804 | + | |
3794 | 3805 | | |
3795 | 3806 | | |
3796 | 3807 | | |
3797 | | - | |
| 3808 | + | |
3798 | 3809 | | |
3799 | 3810 | | |
3800 | 3811 | | |
| |||
0 commit comments