]> Kevux Git Server - rit/commit
t1092: add deeper changes during a checkout
authorDerrick Stolee <dstolee@microsoft.com>
Mon, 6 Dec 2021 14:10:36 +0000 (14:10 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Dec 2021 17:24:53 +0000 (09:24 -0800)
commit1b38efc7a03d149b030154116172c25effde8f50
tree8b7dace5317bdec1629e1bc3dc46fa31b7b757f2
parente9d7761bb94f20acc98824275e317fa82436c25d
t1092: add deeper changes during a checkout

Extend the repository data in the setup of t1092 to include more
directories within two parent directories. This reproduces a bug found
by users of the sparse index feature with suitably-complicated
sparse-checkout definitions.

Add a failing test that fails in its first 'git checkout deepest' run in
the sparse index case with this error:

  error: Your local changes to the following files would be overwritten by checkout:
          deep/deeper1/deepest2/a
          deep/deeper1/deepest3/a
  Please commit your changes or stash them before you switch branches.
  Aborting

The next change will fix this error, and that fix will make it clear why
the extra depth is necessary for revealing this bug. The assignment of
the sparse-checkout definition to include deep/deeper1/deepest as a
sibling directory is important to ensure that deep/deeper1 is not a
sparse directory entry, but deep/deeper1/deepest2 is.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1092-sparse-checkout-compatibility.sh