2 * GIT - The information manager from hell
4 * Copyright (C) Linus Torvalds, 2005
8 static void show_differences(struct cache_entry *ce, struct stat *cur,
9 void *old_contents, unsigned long long old_size)
11 static char cmd[1000];
14 snprintf(cmd, sizeof(cmd), "diff -u - %s", ce->name);
16 fwrite(old_contents, old_size, 1, f);
20 int main(int argc, char **argv)
22 int entries = read_cache();
29 for (i = 0; i < entries; i++) {
31 struct cache_entry *ce = active_cache[i];
37 if (stat(ce->name, &st) < 0) {
38 printf("%s: %s\n", ce->name, strerror(errno));
41 changed = cache_match_stat(ce, &st);
43 printf("%s: ok\n", ce->name);
46 printf("%.*s: ", ce->namelen, ce->name);
47 for (n = 0; n < 20; n++)
48 printf("%02x", ce->sha1[n]);
50 new = read_sha1_file(ce->sha1, type, &size);
51 show_differences(ce, &st, new, size);