Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v1.2.6
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 29 lines (25 sloc) 0.593 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#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;
}
Something went wrong with that request. Please try again.