diff mbox series

[v2,1/9] add-interactive: make sure to release `rev.prune_data`

Message ID 1e02bf2d63e99a6416238999b646998af960bc4b.1575061909.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series build-in add -i: implement all commands in the main loop | expand

Commit Message

Philippe Blain via GitGitGadget Nov. 29, 2019, 9:11 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 add-interactive.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/add-interactive.c b/add-interactive.c
index d6cb98cd40..de2fccb0ef 100644
--- a/add-interactive.c
+++ b/add-interactive.c
@@ -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);