https://github.com/git/git
Raw File
Tip revision: ed9067f705aa51819c7dfff7e4190dd267beaf5d authored by Junio C Hamano on 10 March 2016, 19:16:23 UTC
Git 2.8-rc2
Tip revision: ed9067f
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