]> git.ipfire.org Git - thirdparty/git.git/commit
stash: integrate with sparse index
authorVictoria Dye <vdye@github.com>
Tue, 10 May 2022 23:32:28 +0000 (23:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 May 2022 23:45:12 +0000 (16:45 -0700)
commit3a58792adece081ee84e9827c4d90daf759ceb76
tree841147f0a4e8a6ea3e84a3d9f898e83093612558
parenteae937059be0ae7b4a8e6bfbb985c8c079129419
stash: integrate with sparse index

Enable sparse index in 'git stash' by disabling
'command_requires_full_index'.

With sparse index enabled, some subcommands of 'stash' work without
expanding the index, e.g., 'git stash', 'git stash list', 'git stash drop',
etc. Others ensure the index is expanded either directly (as in the case of
'git stash [pop|apply]', where the call to 'merge_recursive_generic()' in
'do_apply_stash()' triggers the expansion), or in a command called
internally by stash (e.g., 'git update-index' in 'git stash -u'). So, in
addition to enabling sparse index, add tests to 't1092' demonstrating which
variants of 'git stash' expand the index, and which do not.

Finally, add the option to skip writing 'untracked.txt' in
'ensure_not_expanded', and use that option to successfully apply stashed
untracked files without a conflict in 'untracked.txt'.

Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/stash.c
t/t1092-sparse-checkout-compatibility.sh