[PATCH 4/4] Unify pack header checking between index-pack and unpack-objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Both of these builtins share a lot of common code; taking steps to bring
them closer together before a likely future commit to unify some of the
shared code.

Signed-off-by: Dan McGee <dpmcgee@xxxxxxxxx>
---
 builtin/unpack-objects.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index a9e681e..a0dde7f 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -471,10 +471,10 @@ static uint32_t unpack_all(void)
 
 	nr_objects = ntohl(hdr->hdr_entries);
 
-	if (ntohl(hdr->hdr_signature) != PACK_SIGNATURE)
-		die("bad pack file");
+	if (hdr->hdr_signature != htonl(PACK_SIGNATURE))
+		die("pack signature mismatch");
 	if (!pack_version_ok(hdr->hdr_version))
-		die("unknown pack file version %"PRIu32,
+		die("pack version %"PRIu32" unsupported",
 			ntohl(hdr->hdr_version));
 	use(sizeof(struct pack_header));
 
-- 
1.7.4.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]