diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2017-08-19 00:20:29 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-24 00:12:07 +0200 |
commit | 3588dd6e994b38b02c2f60544fe2f69ce5fdf927 (patch) | |
tree | 0a3297c84872f577fb8bf9351811c249f0dff682 /sha1_file.c | |
parent | pack: move get_size_from_delta() (diff) | |
download | git-3588dd6e994b38b02c2f60544fe2f69ce5fdf927.tar.xz git-3588dd6e994b38b02c2f60544fe2f69ce5fdf927.zip |
pack: move unpack_object_header()
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | sha1_file.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/sha1_file.c b/sha1_file.c index 38c1084560..ccf225f055 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1172,32 +1172,6 @@ static const unsigned char *get_delta_base_sha1(struct packed_git *p, return NULL; } -int unpack_object_header(struct packed_git *p, - struct pack_window **w_curs, - off_t *curpos, - unsigned long *sizep) -{ - unsigned char *base; - unsigned long left; - unsigned long used; - enum object_type type; - - /* use_pack() assures us we have [base, base + 20) available - * as a range that we can look at. (Its actually the hash - * size that is assured.) With our object header encoding - * the maximum deflated object size is 2^137, which is just - * insane, so we know won't exceed what we have been given. - */ - base = use_pack(p, w_curs, *curpos, &left); - used = unpack_object_header_buffer(base, left, &type, sizep); - if (!used) { - type = OBJ_BAD; - } else - *curpos += used; - - return type; -} - static int retry_bad_packed_offset(struct packed_git *p, off_t obj_offset) { int type; |