diff options
author | Victoria Dye <vdye@github.com> | 2021-11-29 15:52:42 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-29 12:51:26 -0800 |
commit | 4d1cfc1351ffec47bba1318e9cd1ed13c5182951 (patch) | |
tree | b43e42dcb8810e21933fda314e39f98da4db75b9 /config.h | |
parent | reset: make sparse-aware (except --mixed) (diff) | |
download | tgif-4d1cfc1351ffec47bba1318e9cd1ed13c5182951.tar.xz |
reset: make --mixed sparse-aware
Remove the `ensure_full_index` guard on `read_from_tree` and update `git
reset --mixed` to ensure it can use sparse directory index entries wherever
possible. Sparse directory entries are reset using `diff_tree_oid`, which
requires `change` and `add_remove` functions to process the internal
contents of the sparse directory. The `recursive` diff option handles cases
in which `reset --mixed` must diff/merge files that are nested multiple
levels deep in a sparse directory.
The use of pathspecs with `git reset --mixed` introduces scenarios in which
internal contents of sparse directories may be matched by the pathspec. In
order to reset *all* files in the repo that may match the pathspec, the
following conditions on the pathspec require index expansion before
performing the reset:
* "magic" pathspecs
* wildcard pathspecs that do not match only in-cone files or entire sparse
directories
* literal pathspecs matching something outside the sparse checkout
definition
Helped-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.h')
0 files changed, 0 insertions, 0 deletions