зеркало из https://github.com/microsoft/git.git
Merge branch 'sparse-index/merge' into vfs-2.33.0
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
This commit is contained in:
Коммит
5136c09406
|
@ -1,3 +1,9 @@
|
|||
index.deleteSparseDirectories::
|
||||
When enabled, the cone mode sparse-checkout feature will delete
|
||||
directories that are outside of the sparse-checkout cone, unless
|
||||
such a directory contains an untracked, non-ignored file. Defaults
|
||||
to true.
|
||||
|
||||
index.recordEndOfIndexEntries::
|
||||
Specifies whether the index file should include an "End Of Index
|
||||
Entry" section. This reduces index load time on multiprocessor
|
||||
|
|
|
@ -112,7 +112,7 @@ static int sparse_checkout_list(int argc, const char **argv, const char *prefix)
|
|||
|
||||
static void clean_tracked_sparse_directories(struct repository *r)
|
||||
{
|
||||
int i, was_full = 0;
|
||||
int i, value, was_full = 0;
|
||||
struct strbuf path = STRBUF_INIT;
|
||||
size_t pathlen;
|
||||
struct string_list_item *item;
|
||||
|
@ -128,6 +128,13 @@ static void clean_tracked_sparse_directories(struct repository *r)
|
|||
!r->index->sparse_checkout_patterns->use_cone_patterns)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Users can disable this behavior.
|
||||
*/
|
||||
if (!repo_config_get_bool(r, "index.deletesparsedirectories", &value) &&
|
||||
!value)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Use the sparse index as a data structure to assist finding
|
||||
* directories that are safe to delete. This conversion to a
|
||||
|
|
7
diff.c
7
diff.c
|
@ -3992,6 +3992,13 @@ static int reuse_worktree_file(struct index_state *istate,
|
|||
if (!FAST_WORKING_DIRECTORY && !want_file && has_object_pack(oid))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* If this path does not match our sparse-checkout definition,
|
||||
* then the file will not be in the working directory.
|
||||
*/
|
||||
if (!path_in_sparse_checkout(name, istate))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Similarly, if we'd have to convert the file contents anyway, that
|
||||
* makes the optimization not worthwhile.
|
||||
|
|
|
@ -782,6 +782,10 @@ test_expect_success 'cone mode clears ignored subdirectories' '
|
|||
git -C repo status --porcelain=v2 >out &&
|
||||
test_must_be_empty out &&
|
||||
|
||||
git -C repo -c index.deleteSparseDirectories=false sparse-checkout reapply &&
|
||||
test_path_is_dir repo/folder1 &&
|
||||
test_path_is_dir repo/deep/deeper2 &&
|
||||
|
||||
git -C repo sparse-checkout reapply &&
|
||||
test_path_is_missing repo/folder1 &&
|
||||
test_path_is_missing repo/deep/deeper2 &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче