Thread (47 messages) 47 messages, 5 authors, 2021-12-22

Re: [PATCH v2 2/5] ls-files: add --sparse option

From: Derrick Stolee <hidden>
Date: 2021-12-10 13:51:58

On 12/9/2021 12:08 AM, Elijah Newren wrote:
On Wed, Dec 8, 2021 at 11:39 AM Derrick Stolee via GitGitGadget
quoted
+       # With --sparse and no sparse index, nothing changes.
+       git -C sparse-checkout ls-files >dense &&
+       git -C sparse-checkout ls-files --sparse >sparse &&
+       test_cmp dense sparse &&
+
I still believe this next section deserves a comment; something like

# Set up an erroneous condition: folder1/a present despite SKIP_WORKTREE.
# We do this just to verify consistency between sparse-index and
non-sparse-index
# with such files.
quoted
+       write_script edit-content <<-\EOF &&
+       mkdir folder1 &&
+       echo content >>folder1/a
+       EOF
+       run_on_sparse ../edit-content &&
+
+       # ls-files does not notice modified files whose
+       # cache entries are marked SKIP_WORKTREE.
I also believe this still deserves a slight change, e.g.

# ls-files does not currently notice modified files whose
# cache entries are marked SKIP_WORKTREE; this
# may change in the future, but we test here that
# sparse-index and non-sparse-index at least match.

quoted
+       test_sparse_match git ls-files --modified &&
+       test_must_be_empty sparse-checkout-out &&
+       test_must_be_empty sparse-index-out &&
Ok. Sorry I missed these in the gap between v1 and v2.

Thanks,
-Stolee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help