From: Junio C Hamano Date: Tue, 18 Apr 2023 01:05:11 +0000 (-0700) Subject: Merge branch 'sl/sparse-write-tree' X-Git-Tag: v2.41.0-rc0~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d47ee0a5653441ae727e22b8985c517132c42d4c;p=thirdparty%2Fgit.git Merge branch 'sl/sparse-write-tree' "git write-tree" learns to work better with sparse-index. * sl/sparse-write-tree: write-tree: integrate with sparse index --- d47ee0a5653441ae727e22b8985c517132c42d4c diff --cc builtin/write-tree.c index 6085f64d10,a767830096..32e302a813 --- a/builtin/write-tree.c +++ b/builtin/write-tree.c @@@ -41,8 -38,10 +41,11 @@@ int cmd_write_tree(int argc, const cha argc = parse_options(argc, argv, cmd_prefix, write_tree_options, write_tree_usage, 0); + prepare_repo_settings(the_repository); + the_repository->settings.command_requires_full_index = 0; + - ret = write_cache_as_tree(&oid, flags, tree_prefix); + ret = write_index_as_tree(&oid, &the_index, get_index_file(), flags, + tree_prefix); switch (ret) { case 0: printf("%s\n", oid_to_hex(&oid)); diff --cc t/perf/p2000-sparse-operations.sh index e4a132f593,5fe6bf3ddd..f7bdba90c5 --- a/t/perf/p2000-sparse-operations.sh +++ b/t/perf/p2000-sparse-operations.sh @@@ -124,6 -124,7 +124,7 @@@ test_perf_on_all git read-tree -mu HEA test_perf_on_all git checkout-index -f --all test_perf_on_all git update-index --add --remove $SPARSE_CONE/a test_perf_on_all "git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a" -test_perf_on_all git grep --cached --sparse bogus -- "f2/f1/f1/*" +test_perf_on_all git grep --cached bogus -- "f2/f1/f1/*" + test_perf_on_all git write-tree test_done