summaryrefslogtreecommitdiff
path: root/midx.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-19 00:58:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-19 00:58:00 (GMT)
commit9b8074427bd2bb52d0c7ec876ebe0e6834bb69fe (patch)
tree2878fe56589a29032ac39c6d2c763452045f464b /midx.c
parent54e85e7af1ac9e9a92888060d6811ae767fea1bc (diff)
parent7744a5d6921c457a05224cd7f5554e972df634b0 (diff)
downloadgit-9b8074427bd2bb52d0c7ec876ebe0e6834bb69fe.zip
git-9b8074427bd2bb52d0c7ec876ebe0e6834bb69fe.tar.gz
git-9b8074427bd2bb52d0c7ec876ebe0e6834bb69fe.tar.bz2
Merge branch 'rs/misc-cleanups'
Misc cleanups. * rs/misc-cleanups: pack-bitmap-write: use hashwrite_be32() in write_hash_cache() midx: use hashwrite_u8() in write_midx_header() fast-import: use write_pack_header()
Diffstat (limited to 'midx.c')
-rw-r--r--midx.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/midx.c b/midx.c
index cc19b66..0de42ff 100644
--- a/midx.c
+++ b/midx.c
@@ -432,14 +432,11 @@ static size_t write_midx_header(struct hashfile *f,
unsigned char num_chunks,
uint32_t num_packs)
{
- unsigned char byte_values[4];
-
hashwrite_be32(f, MIDX_SIGNATURE);
- byte_values[0] = MIDX_VERSION;
- byte_values[1] = oid_version();
- byte_values[2] = num_chunks;
- byte_values[3] = 0; /* unused */
- hashwrite(f, byte_values, sizeof(byte_values));
+ hashwrite_u8(f, MIDX_VERSION);
+ hashwrite_u8(f, oid_version());
+ hashwrite_u8(f, num_chunks);
+ hashwrite_u8(f, 0); /* unused */
hashwrite_be32(f, num_packs);
return MIDX_HEADER_SIZE;