diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-05 10:43:03 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-05 10:43:03 -0800 |
commit | e8e71848ea866d7dc34eacffc20b9c3826ae29a1 (patch) | |
tree | 3baa258f1b1a5671948b7677169b0af70a06dc06 /packfile.h | |
parent | Merge branch 'es/do-not-let-rebase-switch-to-protected-branch' (diff) | |
parent | packfile: drop nth_packed_object_sha1() (diff) | |
download | tgif-e8e71848ea866d7dc34eacffc20b9c3826ae29a1.tar.xz |
Merge branch 'jk/nth-packed-object-id'
Code cleanup to use "struct object_id" more by replacing use of
"char *sha1"
* jk/nth-packed-object-id:
packfile: drop nth_packed_object_sha1()
packed_object_info(): use object_id internally for delta base
packed_object_info(): use object_id for returning delta base
pack-check: push oid lookup into loop
pack-check: convert "internal error" die to a BUG()
pack-bitmap: use object_id when loading on-disk bitmaps
pack-objects: use object_id struct in pack-reuse code
pack-objects: convert oe_set_delta_ext() to use object_id
pack-objects: read delta base oid into object_id struct
nth_packed_object_oid(): use customary integer return
Diffstat (limited to 'packfile.h')
-rw-r--r-- | packfile.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/packfile.h b/packfile.h index ec536a4ae5..240aa73b95 100644 --- a/packfile.h +++ b/packfile.h @@ -121,18 +121,11 @@ void check_pack_index_ptr(const struct packed_git *p, const void *ptr); int bsearch_pack(const struct object_id *oid, const struct packed_git *p, uint32_t *result); /* - * Return the SHA-1 of the nth object within the specified packfile. - * Open the index if it is not already open. The return value points - * at the SHA-1 within the mmapped index. Return NULL if there is an - * error. + * Write the oid of the nth object within the specified packfile into the first + * parameter. Open the index if it is not already open. Returns 0 on success, + * negative otherwise. */ -const unsigned char *nth_packed_object_sha1(struct packed_git *, uint32_t n); -/* - * Like nth_packed_object_sha1, but write the data into the object specified by - * the the first argument. Returns the first argument on success, and NULL on - * error. - */ -const struct object_id *nth_packed_object_oid(struct object_id *, struct packed_git *, uint32_t n); +int nth_packed_object_id(struct object_id *, struct packed_git *, uint32_t n); /* * Return the offset of the nth object within the specified packfile. |