summaryrefslogtreecommitdiff
path: root/archive-zip.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-05-05 21:00:23 -0700
committerJunio C Hamano <gitster@pobox.com>2015-05-05 21:00:23 -0700
commita916cb5fb4824322d7e99b1b0efad4e6d7850e78 (patch)
treed9ccc322b7b02d3af296ef313df8dc046ca3fc7d /archive-zip.c
parent3d4a3ffe64162b45ae7c991fc60623ecb4678cfd (diff)
parentd07d4ab401173a10173f2747cf5e0f074b6d2b39 (diff)
downloadgit-a916cb5fb4824322d7e99b1b0efad4e6d7850e78.tar.gz
Merge branch 'bc/object-id'
Identify parts of the code that knows that we use SHA-1 hash to name our objects too much, and use (1) symbolic constants instead of hardcoded 20 as byte count and/or (2) use struct object_id instead of unsigned char [20] for object names. * bc/object-id: apply: convert threeway_stage to object_id patch-id: convert to use struct object_id commit: convert parts to struct object_id diff: convert struct combine_diff_path to object_id bulk-checkin.c: convert to use struct object_id zip: use GIT_SHA1_HEXSZ for trailers archive.c: convert to use struct object_id bisect.c: convert leaf functions to use struct object_id define utility functions for object IDs define a structure for object IDs
Diffstat (limited to 'archive-zip.c')
-rw-r--r--archive-zip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archive-zip.c b/archive-zip.c
index ffb3535e93..ae3d67f9d3 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -448,12 +448,12 @@ static void write_zip_trailer(const unsigned char *sha1)
copy_le16(trailer.entries, zip_dir_entries);
copy_le32(trailer.size, zip_dir_offset);
copy_le32(trailer.offset, zip_offset);
- copy_le16(trailer.comment_length, sha1 ? 40 : 0);
+ copy_le16(trailer.comment_length, sha1 ? GIT_SHA1_HEXSZ : 0);
write_or_die(1, zip_dir, zip_dir_offset);
write_or_die(1, &trailer, ZIP_DIR_TRAILER_SIZE);
if (sha1)
- write_or_die(1, sha1_to_hex(sha1), 40);
+ write_or_die(1, sha1_to_hex(sha1), GIT_SHA1_HEXSZ);
}
static void dos_time(time_t *time, int *dos_date, int *dos_time)