summaryrefslogtreecommitdiff
path: root/sparse-index.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-03-30 13:10:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-30 19:57:47 (GMT)
commitf442313e2e7a2ebf592a5943d4d4392e88153484 (patch)
tree0e03d818e83c8e7f7078ddb23d03e85eb99c588d /sparse-index.c
parent6e773527b6b03976cefbb0f9571bd40dd5995e6c (diff)
downloadgit-f442313e2e7a2ebf592a5943d4d4392e88153484.zip
git-f442313e2e7a2ebf592a5943d4d4392e88153484.tar.gz
git-f442313e2e7a2ebf592a5943d4d4392e88153484.tar.bz2
submodule: sparse-index should not collapse links
A submodule is stored as a "Git link" that actually points to a commit within a submodule. Submodules are populated or not depending on submodule configuration, not sparse-checkout. To ensure that the sparse-index feature integrates correctly with submodules, we should not collapse a directory if there is a Git link within its range. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sparse-index.c')
-rw-r--r--sparse-index.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sparse-index.c b/sparse-index.c
index 619ff7c..7631f7b 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -52,6 +52,7 @@ static int convert_to_sparse_rec(struct index_state *istate,
struct cache_entry *ce = istate->cache[i];
if (ce_stage(ce) ||
+ S_ISGITLINK(ce->ce_mode) ||
!(ce->ce_flags & CE_SKIP_WORKTREE))
can_convert = 0;
}