https://github.com/git/git
Revision b4f86a4ce85e4e370a67455de6586a02f158a789 authored by Junio C Hamano on 02 May 2014, 20:15:52 UTC, committed by Junio C Hamano on 02 May 2014, 20:15:52 UTC
1 parent 648d9c1
Raw File
Tip revision: b4f86a4ce85e4e370a67455de6586a02f158a789 authored by Junio C Hamano on 02 May 2014, 20:15:52 UTC
Git 2.0-rc2
Tip revision: b4f86a4
test-index-version.c
#include "cache.h"

int main(int argc, char **argv)
{
	struct cache_header hdr;
	int version;

	memset(&hdr,0,sizeof(hdr));
	if (read(0, &hdr, sizeof(hdr)) != sizeof(hdr))
		return 0;
	version = ntohl(hdr.hdr_version);
	printf("%d\n", version);
	return 0;
}
back to top