summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/sparse-checkout.c1
-rw-r--r--unpack-trees.c6
-rw-r--r--unpack-trees.h3
3 files changed, 5 insertions, 5 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index 740da4b6d5..d102a9697f 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -122,7 +122,6 @@ static int update_working_directory(struct pattern_list *pl)
o.dst_index = r->index;
o.skip_sparse_checkout = 0;
o.pl = pl;
- o.keep_pattern_list = !!pl;
resolve_undo_clear_index(r->index);
setup_work_tree();
diff --git a/unpack-trees.c b/unpack-trees.c
index 3af2e126ab..d2863fa031 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1503,6 +1503,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
int i, ret;
static struct cache_entry *dfc;
struct pattern_list pl;
+ int free_pattern_list = 0;
if (len > MAX_UNPACK_TREES)
die("unpack_trees takes at most %d trees", MAX_UNPACK_TREES);
@@ -1519,6 +1520,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
else
o->pl = &pl;
free(sparse);
+ free_pattern_list = 1;
}
memset(&o->result, 0, sizeof(o->result));
@@ -1686,9 +1688,9 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
o->src_index = NULL;
done:
- trace_performance_leave("unpack_trees");
- if (!o->keep_pattern_list)
+ if (free_pattern_list)
clear_pattern_list(&pl);
+ trace_performance_leave("unpack_trees");
return ret;
return_failed:
diff --git a/unpack-trees.h b/unpack-trees.h
index 6d7c7b6c2e..d3516267f3 100644
--- a/unpack-trees.h
+++ b/unpack-trees.h
@@ -58,8 +58,7 @@ struct unpack_trees_options {
quiet,
exiting_early,
show_all_errors,
- dry_run,
- keep_pattern_list;
+ dry_run;
const char *prefix;
int cache_bottom;
struct dir_struct *dir;