Staging
v0.5.1
https://github.com/git/git
Revision f7a2eb735982e921ae4379f1dcf5f7a023610393 authored by Junio C Hamano on 12 November 2005, 06:37:38 UTC, committed by Junio C Hamano on 12 November 2005, 06:37:38 UTC
This is GIT 1.0-rc1 in disguise.  It is plausible that
relatively new parts of the system still need tweaking and
fixing, but that is why it is not 1.0 but rc ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2 parent s 23ea3e2 + 7765e7e
Raw File
Tip revision: f7a2eb735982e921ae4379f1dcf5f7a023610393 authored by Junio C Hamano on 12 November 2005, 06:37:38 UTC
GIT 0.99.9h
Tip revision: f7a2eb7
show-index.c
#include "cache.h"

int main(int argc, char **argv)
{
	int i;
	unsigned nr;
	unsigned int entry[6];
	static unsigned int top_index[256];

	if (fread(top_index, sizeof(top_index), 1, stdin) != 1)
		die("unable to read idex");
	nr = 0;
	for (i = 0; i < 256; i++) {
		unsigned n = ntohl(top_index[i]);
		if (n < nr)
			die("corrupt index file");
		nr = n;
	}
	for (i = 0; i < nr; i++) {
		unsigned offset;

		if (fread(entry, 24, 1, stdin) != 1)
			die("unable to read entry %u/%u", i, nr);
		offset = ntohl(entry[0]);
		printf("%u %s\n", offset, sha1_to_hex((void *)(entry+1)));
	}
	return 0;
}
back to top