]> git.ipfire.org Git - thirdparty/git.git/commitdiff
add-interactive: make sure to release `rev.prune_data`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 29 Nov 2019 21:11:41 +0000 (21:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 1 Dec 2019 15:30:53 +0000 (07:30 -0800)
During a review, Junio Hamano pointed out that the `rev.prune_data` was
copied from another pathspec but never cleaned up.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-interactive.c

index d6cb98cd405fc4e8ff4bf0fc5a158caa729c5058..de2fccb0ef338273ed600eec6d2f755b278b87e3 100644 (file)
@@ -435,6 +435,9 @@ static int get_modified_files(struct repository *r, struct string_list *files,
                        rev.diffopt.flags.ignore_dirty_submodules = 1;
                        run_diff_files(&rev, 0);
                }
+
+               if (ps)
+                       clear_pathspec(&rev.prune_data);
        }
        hashmap_free_entries(&s.file_map, struct pathname_entry, ent);