- files = adds = dels = 0;
- if (!patch)
- die("no patch found");
- do {
- if (check)
- check_patch(patch);
-
- if (diffstat) {
- files++;
- adds += patch->lines_added;
- dels += patch->lines_deleted;
- show_stats(patch);
+static void show_file(int c, unsigned int mode, const char *name)
+{
+ printf("%c %o %s\n", c, mode, name);
+}
+
+static void show_file_list(struct patch *patch)
+{
+ for (;patch ; patch = patch->next) {
+ if (patch->is_rename) {
+ show_file('-', patch->old_mode, patch->old_name);
+ show_file('+', patch->new_mode, patch->new_name);
+ continue;
+ }
+ if (patch->is_copy || patch->is_new) {
+ show_file('+', patch->new_mode, patch->new_name);
+ continue;
+ }
+ if (patch->is_delete) {
+ show_file('-', patch->old_mode, patch->old_name);
+ continue;