sparse-checkout: avoid using internal API of unpack-trees
struct unpack_trees_options has the following field and comment:
struct pattern_list *pl; /* for internal use */
Despite the internal-use comment, commit e091228e17
("sparse-checkout:
update working directory in-process", 2019-11-21) starting setting this
field from an external caller. At the time, the only way around that
would have been to modify unpack_trees() to take an extra pattern_list
argument, and there's a lot of callers of that function. However, when
we split update_sparsity() off as a separate function, with
sparse-checkout being the sole caller, the need to update other callers
went away. Fix this API problem by adding a pattern_list argument to
update_sparsity() and stop setting the internal o.pl field directly.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
5d4f4a592e
commit
1147c56ff7
@ -112,7 +112,8 @@ enum update_sparsity_result {
|
||||
UPDATE_SPARSITY_WORKTREE_UPDATE_FAILURES = -2
|
||||
};
|
||||
|
||||
enum update_sparsity_result update_sparsity(struct unpack_trees_options *options);
|
||||
enum update_sparsity_result update_sparsity(struct unpack_trees_options *options,
|
||||
struct pattern_list *pl);
|
||||
|
||||
int verify_uptodate(const struct cache_entry *ce,
|
||||
struct unpack_trees_options *o);
|
||||
|
Reference in New Issue
Block a user