Staging
v0.5.2
https://github.com/git/git
Revision 3b97fee23df7ec78eea77151fcc0885ec3191950 authored by Eric Wong on 11 January 2007, 21:43:40 UTC, committed by Junio C Hamano on 11 January 2007, 22:49:45 UTC
Unfortunately, while {read,write}_in_full do take into account
zero-sized reads/writes; their die and whine variants do not.

I have a repository where there are zero-sized files in
the history that was triggering these things.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 9130ac1
Raw File
Tip revision: 3b97fee23df7ec78eea77151fcc0885ec3191950 authored by Eric Wong on 11 January 2007, 21:43:40 UTC
Avoid errors and warnings when attempting to do I/O on zero bytes
Tip revision: 3b97fee
pack.h
#ifndef PACK_H
#define PACK_H

#include "object.h"

/*
 * Packed object header
 */
#define PACK_SIGNATURE 0x5041434b	/* "PACK" */
#define PACK_VERSION 2
#define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3))
struct pack_header {
	unsigned int hdr_signature;
	unsigned int hdr_version;
	unsigned int hdr_entries;
};

extern int verify_pack(struct packed_git *, int);
#endif
back to top