summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-08-16 01:57:57 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-01-14 02:15:04 -0500
commitc90be46abdbd102ab8e9af0303d33976d552ae58 (patch)
treec5e51c75a69121545b25804b0e287f3f98a21943 /fast-import.c
parentc44cdc7eef212ec09901eb2e0996476e0468ed88 (diff)
downloadgit-c90be46abdbd102ab8e9af0303d33976d552ae58.tar.gz
Changed fast-import's pack header creation to use pack.h
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fast-import.c b/fast-import.c
index 2953e80cde..d5651693ba 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -800,15 +800,14 @@ del_entry:
static void init_pack_header()
{
- const char* magic = "PACK";
- unsigned long version = 3;
- unsigned long zero = 0;
-
- version = htonl(version);
- ywrite(pack_fd, (char*)magic, 4);
- ywrite(pack_fd, &version, 4);
- ywrite(pack_fd, &zero, 4);
- pack_offset = 4 * 3;
+ struct pack_header hdr;
+
+ hdr.hdr_signature = htonl(PACK_SIGNATURE);
+ hdr.hdr_version = htonl(2);
+ hdr.hdr_entries = 0;
+
+ ywrite(pack_fd, &hdr, sizeof(hdr));
+ pack_offset = sizeof(hdr);
}
static void fixup_header_footer()