Staging
v0.5.2
https://github.com/git/git
Revision 9ccb64c8e0791a865ad520bcfff4b02cc7c50097 authored by Junio C Hamano on 05 October 2006, 09:26:12 UTC, committed by Junio C Hamano on 05 October 2006, 09:26:12 UTC
It is silly to keep using git-tar-tree in dist target when the
command gives a big deprecation warning when called.  Instead,
use "git-archive --format=tar" which we recommend to our users.

Update gitweb's snapshot feature to use git-archive for the same
reason.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 6030649
Raw File
Tip revision: 9ccb64c8e0791a865ad520bcfff4b02cc7c50097 authored by Junio C Hamano on 05 October 2006, 09:26:12 UTC
tar-tree deprecation: we eat our own dog food.
Tip revision: 9ccb64c
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