-static int generate_patch = 0;
-static int line_termination = '\n';
-static int silent = 0;
-
-static int matches_pathspec(struct cache_entry *ce, char **spec, int cnt)
-{
- int i;
- int namelen = ce_namelen(ce);
- for (i = 0; i < cnt; i++) {
- int speclen = strlen(spec[i]);
- if (! strncmp(spec[i], ce->name, speclen) &&
- speclen <= namelen &&
- (ce->name[speclen] == 0 ||
- ce->name[speclen] == '/'))
- return 1;
- }
- return 0;
-}
-
-static void show_unmerge(const char *path)
-{
- if (generate_patch)
- diff_unmerge(path);
- else
- printf("U %s%c", path, line_termination);
-}
-
-static void show_file(int pfx, struct cache_entry *ce)
-{
- if (generate_patch)
- diff_addremove(pfx, ntohl(ce->ce_mode), ce->sha1,
- ce->name, NULL);
- else
- printf("%c%06o\t%s\t%s\t%s%c",
- pfx, ntohl(ce->ce_mode), "blob",
- sha1_to_hex(ce->sha1), ce->name, line_termination);
-}
-
-static void show_modified(int oldmode, int mode,
- const char *old_sha1, const char *sha1,
- char *path)