aboutsummaryrefslogtreecommitdiffstats
path: root/diff-lib.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-18 13:07:04 -0700
committerJunio C Hamano <gitster@pobox.com>2022-08-18 13:07:04 -0700
commit80ffc849bdd5ed111a2ec070856ef67e075572c6 (patch)
treee40b7bd0e84ae6ea1fdd5066ef6c42cf98e3ecfc /diff-lib.c
parent0d133a3dcf43eb0396a5899008a4ff4ceaeb0d6e (diff)
parentb15207b8cf1a1930fe5eb076c08c6ddc92d9282d (diff)
downloadgit-80ffc849bdd5ed111a2ec070856ef67e075572c6.tar.gz
Merge branch 'vd/sparse-reset-checkout-fixes'
Fixes to sparse index compatibility work for "reset" and "checkout" commands. * vd/sparse-reset-checkout-fixes: unpack-trees: unpack new trees as sparse directories cache.h: create 'index_name_pos_sparse()' oneway_diff: handle removed sparse directories checkout: fix nested sparse directory diff in sparse index
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/diff-lib.c b/diff-lib.c
index 7eb66a417a..2edea41a23 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -466,6 +466,11 @@ static void do_oneway_diff(struct unpack_trees_options *o,
* Something removed from the tree?
*/
if (!idx) {
+ if (S_ISSPARSEDIR(tree->ce_mode)) {
+ diff_tree_oid(&tree->oid, NULL, tree->name, &revs->diffopt);
+ return;
+ }
+
diff_index_show_file(revs, "-", tree, &tree->oid, 1,
tree->ce_mode, 0);
return;