2009-08-20 17:47:12 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-07-31 10:14:25 +04:00
|
|
|
test_description='sparse checkout tests
|
|
|
|
|
2020-11-19 02:44:21 +03:00
|
|
|
* (tag: removed, main) removed
|
2010-07-31 10:14:25 +04:00
|
|
|
| D sub/added
|
|
|
|
* (HEAD, tag: top) modified and added
|
|
|
|
| M init.t
|
|
|
|
| A sub/added
|
|
|
|
* (tag: init) init
|
|
|
|
A init.t
|
|
|
|
'
|
2009-08-20 17:47:12 +04:00
|
|
|
|
|
|
|
. ./test-lib.sh
|
2011-05-26 00:10:41 +04:00
|
|
|
. "$TEST_DIRECTORY"/lib-read-tree.sh
|
2009-08-20 17:47:12 +04:00
|
|
|
|
|
|
|
test_expect_success 'setup' '
|
2018-03-25 22:20:46 +03:00
|
|
|
test_commit init &&
|
|
|
|
echo modified >>init.t &&
|
|
|
|
|
2016-07-16 08:06:25 +03:00
|
|
|
cat >expected <<-EOF &&
|
2018-03-25 22:20:46 +03:00
|
|
|
100644 $(git hash-object init.t) 0 init.t
|
2016-07-16 08:06:25 +03:00
|
|
|
100644 $EMPTY_BLOB 0 sub/added
|
|
|
|
100644 $EMPTY_BLOB 0 sub/addedtoo
|
|
|
|
100644 $EMPTY_BLOB 0 subsub/added
|
2010-07-31 10:14:25 +04:00
|
|
|
EOF
|
|
|
|
cat >expected.swt <<-\EOF &&
|
|
|
|
H init.t
|
|
|
|
H sub/added
|
2011-05-02 16:47:43 +04:00
|
|
|
H sub/addedtoo
|
2010-11-07 21:04:58 +03:00
|
|
|
H subsub/added
|
2010-07-31 10:14:25 +04:00
|
|
|
EOF
|
|
|
|
|
2010-11-07 21:04:58 +03:00
|
|
|
mkdir sub subsub &&
|
2011-05-02 16:47:43 +04:00
|
|
|
touch sub/added sub/addedtoo subsub/added &&
|
|
|
|
git add init.t sub/added sub/addedtoo subsub/added &&
|
2009-08-20 17:47:12 +04:00
|
|
|
git commit -m "modified and added" &&
|
|
|
|
git tag top &&
|
|
|
|
git rm sub/added &&
|
|
|
|
git commit -m removed &&
|
|
|
|
git tag removed &&
|
|
|
|
git checkout top &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files --stage >result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test_cmp expected result
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'read-tree without .git/info/sparse-checkout' '
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files --stage >result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test_cmp expected result &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files -t >result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test_cmp expected.swt result
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'read-tree with .git/info/sparse-checkout but disabled' '
|
2010-10-31 04:46:54 +03:00
|
|
|
echo >.git/info/sparse-checkout &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files -t >result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test_cmp expected.swt result &&
|
|
|
|
test -f init.t &&
|
|
|
|
test -f sub/added
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'read-tree --no-sparse-checkout with empty .git/info/sparse-checkout and enabled' '
|
|
|
|
git config core.sparsecheckout true &&
|
2010-07-31 10:14:25 +04:00
|
|
|
echo >.git/info/sparse-checkout &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --no-sparse-checkout -m -u HEAD &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files -t >result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test_cmp expected.swt result &&
|
|
|
|
test -f init.t &&
|
|
|
|
test -f sub/added
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'read-tree with empty .git/info/sparse-checkout' '
|
|
|
|
git config core.sparsecheckout true &&
|
2010-07-31 10:14:25 +04:00
|
|
|
echo >.git/info/sparse-checkout &&
|
2020-05-04 21:27:43 +03:00
|
|
|
read_tree_u_must_succeed -m -u HEAD &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files --stage >result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test_cmp expected result &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files -t >result &&
|
2020-05-04 21:27:43 +03:00
|
|
|
cat >expected.swt <<-\EOF &&
|
|
|
|
S init.t
|
|
|
|
S sub/added
|
|
|
|
S sub/addedtoo
|
|
|
|
S subsub/added
|
|
|
|
EOF
|
2009-08-20 17:47:12 +04:00
|
|
|
test_cmp expected.swt result &&
|
2020-05-04 21:27:43 +03:00
|
|
|
! test -f init.t &&
|
|
|
|
! test -f sub/added
|
2009-08-20 17:47:12 +04:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'match directories with trailing slash' '
|
2010-07-31 10:14:25 +04:00
|
|
|
cat >expected.swt-noinit <<-\EOF &&
|
|
|
|
S init.t
|
|
|
|
H sub/added
|
2011-05-02 16:47:43 +04:00
|
|
|
H sub/addedtoo
|
2010-11-07 21:04:58 +03:00
|
|
|
S subsub/added
|
2010-07-31 10:14:25 +04:00
|
|
|
EOF
|
|
|
|
|
2009-08-20 17:47:12 +04:00
|
|
|
echo sub/ > .git/info/sparse-checkout &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD &&
|
2009-08-20 17:47:12 +04:00
|
|
|
git ls-files -t > result &&
|
2010-07-31 10:14:25 +04:00
|
|
|
test_cmp expected.swt-noinit result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test ! -f init.t &&
|
|
|
|
test -f sub/added
|
|
|
|
'
|
|
|
|
|
2010-11-26 21:17:46 +03:00
|
|
|
test_expect_success 'match directories without trailing slash' '
|
2011-05-02 16:47:43 +04:00
|
|
|
echo sub >.git/info/sparse-checkout &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files -t >result &&
|
2010-11-26 21:17:46 +03:00
|
|
|
test_cmp expected.swt-noinit result &&
|
|
|
|
test ! -f init.t &&
|
|
|
|
test -f sub/added
|
|
|
|
'
|
|
|
|
|
2011-05-09 19:43:01 +04:00
|
|
|
test_expect_success 'match directories with negated patterns' '
|
|
|
|
cat >expected.swt-negation <<\EOF &&
|
|
|
|
S init.t
|
|
|
|
S sub/added
|
|
|
|
H sub/addedtoo
|
|
|
|
S subsub/added
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat >.git/info/sparse-checkout <<\EOF &&
|
|
|
|
sub
|
|
|
|
!sub/added
|
|
|
|
EOF
|
|
|
|
git read-tree -m -u HEAD &&
|
|
|
|
git ls-files -t >result &&
|
|
|
|
test_cmp expected.swt-negation result &&
|
|
|
|
test ! -f init.t &&
|
|
|
|
test ! -f sub/added &&
|
|
|
|
test -f sub/addedtoo
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'match directories with negated patterns (2)' '
|
|
|
|
cat >expected.swt-negation2 <<\EOF &&
|
|
|
|
H init.t
|
|
|
|
H sub/added
|
|
|
|
S sub/addedtoo
|
|
|
|
H subsub/added
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat >.git/info/sparse-checkout <<\EOF &&
|
|
|
|
/*
|
|
|
|
!sub
|
|
|
|
sub/added
|
|
|
|
EOF
|
|
|
|
git read-tree -m -u HEAD &&
|
|
|
|
git ls-files -t >result &&
|
|
|
|
test_cmp expected.swt-negation2 result &&
|
|
|
|
test -f init.t &&
|
|
|
|
test -f sub/added &&
|
|
|
|
test ! -f sub/addedtoo
|
|
|
|
'
|
|
|
|
|
2010-11-26 21:17:46 +03:00
|
|
|
test_expect_success 'match directory pattern' '
|
2011-05-02 16:47:43 +04:00
|
|
|
echo "s?b" >.git/info/sparse-checkout &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD &&
|
2010-11-26 21:17:46 +03:00
|
|
|
git ls-files -t >result &&
|
|
|
|
test_cmp expected.swt-noinit result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test ! -f init.t &&
|
|
|
|
test -f sub/added
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'checkout area changes' '
|
2010-07-31 10:14:25 +04:00
|
|
|
cat >expected.swt-nosub <<-\EOF &&
|
|
|
|
H init.t
|
|
|
|
S sub/added
|
2011-05-02 16:47:43 +04:00
|
|
|
S sub/addedtoo
|
2010-11-07 21:04:58 +03:00
|
|
|
S subsub/added
|
2010-07-31 10:14:25 +04:00
|
|
|
EOF
|
|
|
|
|
|
|
|
echo init.t >.git/info/sparse-checkout &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD &&
|
2010-07-31 10:14:25 +04:00
|
|
|
git ls-files -t >result &&
|
|
|
|
test_cmp expected.swt-nosub result &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test -f init.t &&
|
|
|
|
test ! -f sub/added
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'read-tree updates worktree, absent case' '
|
2010-07-31 10:14:25 +04:00
|
|
|
echo sub/added >.git/info/sparse-checkout &&
|
2009-08-20 17:47:12 +04:00
|
|
|
git checkout -f top &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD^ &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test ! -f init.t
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'read-tree updates worktree, dirty case' '
|
2010-07-31 10:14:25 +04:00
|
|
|
echo sub/added >.git/info/sparse-checkout &&
|
2009-08-20 17:47:12 +04:00
|
|
|
git checkout -f top &&
|
2010-07-31 10:14:25 +04:00
|
|
|
echo dirty >init.t &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD^ &&
|
2009-08-20 17:47:12 +04:00
|
|
|
grep -q dirty init.t &&
|
|
|
|
rm init.t
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'read-tree removes worktree, dirty case' '
|
2010-07-31 10:14:25 +04:00
|
|
|
echo init.t >.git/info/sparse-checkout &&
|
2009-08-20 17:47:12 +04:00
|
|
|
git checkout -f top &&
|
2010-07-31 10:14:25 +04:00
|
|
|
echo dirty >added &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u HEAD^ &&
|
2009-08-20 17:47:12 +04:00
|
|
|
grep -q dirty added
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'read-tree adds to worktree, absent case' '
|
2010-07-31 10:14:25 +04:00
|
|
|
echo init.t >.git/info/sparse-checkout &&
|
2009-08-20 17:47:12 +04:00
|
|
|
git checkout -f removed &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -u -m HEAD^ &&
|
2009-08-20 17:47:12 +04:00
|
|
|
test ! -f sub/added
|
|
|
|
'
|
|
|
|
|
2010-07-31 10:14:29 +04:00
|
|
|
test_expect_success 'read-tree adds to worktree, dirty case' '
|
2010-07-31 10:14:25 +04:00
|
|
|
echo init.t >.git/info/sparse-checkout &&
|
2009-08-20 17:47:12 +04:00
|
|
|
git checkout -f removed &&
|
|
|
|
mkdir sub &&
|
2010-07-31 10:14:25 +04:00
|
|
|
echo dirty >sub/added &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -u -m HEAD^ &&
|
2009-08-20 17:47:12 +04:00
|
|
|
grep -q dirty sub/added
|
|
|
|
'
|
|
|
|
|
2010-07-31 10:14:26 +04:00
|
|
|
test_expect_success 'index removal and worktree narrowing at the same time' '
|
|
|
|
echo init.t >.git/info/sparse-checkout &&
|
|
|
|
echo sub/added >>.git/info/sparse-checkout &&
|
|
|
|
git checkout -f top &&
|
|
|
|
echo init.t >.git/info/sparse-checkout &&
|
|
|
|
git checkout removed &&
|
|
|
|
git ls-files sub/added >result &&
|
|
|
|
test ! -f sub/added &&
|
2019-11-27 10:51:43 +03:00
|
|
|
test_must_be_empty result
|
2010-07-31 10:14:26 +04:00
|
|
|
'
|
|
|
|
|
2010-07-31 10:14:27 +04:00
|
|
|
test_expect_success 'read-tree --reset removes outside worktree' '
|
|
|
|
echo init.t >.git/info/sparse-checkout &&
|
|
|
|
git checkout -f top &&
|
|
|
|
git reset --hard removed &&
|
|
|
|
git ls-files sub/added >result &&
|
2018-07-27 20:48:11 +03:00
|
|
|
test_must_be_empty result
|
2010-07-31 10:14:27 +04:00
|
|
|
'
|
|
|
|
|
unpack-trees: failure to set SKIP_WORKTREE bits always just a warning
Setting and clearing of the SKIP_WORKTREE bit is not only done when
users run 'sparse-checkout'; other commands such as 'checkout' also run
through unpack_trees() which has logic for handling this special bit.
As such, we need to consider how they handle special cases. A couple
comparison points should help explain the rationale for changing how
unpack_trees() handles these bits:
Ignoring sparse checkouts for a moment, if you are switching
branches and have dirty changes, it is only considered an error that
will prevent the branch switching from being successful if the dirty
file happens to be one of the paths with different contents.
SKIP_WORKTREE has always been considered advisory; for example, if
rebase or merge need or even want to materialize a path as part of
their work, they have always been allowed to do so regardless of the
SKIP_WORKTREE setting. This has been used for unmerged paths, but
it was often used for paths it wasn't needed just because it made
the code simpler. It was a best-effort consideration, and when it
materialized paths contrary to the SKIP_WORKTREE setting, it was
never required to even print a warning message.
In the past if you trying to run e.g. 'git checkout' and:
1) you had a path that was materialized and had some dirty changes
2) the path was listed in $GITDIR/info/sparse-checkout
3) this path did not different between the current and target branches
then despite the comparison points above, the inability to set
SKIP_WORKTREE was treated as a *hard* error that would abort the
checkout operation. This is completely inconsistent with how
SKIP_WORKTREE is handled elsewhere, and rather annoying for users as
leaving the paths materialized in the working copy (with a simple
warning) should present no problem at all.
Downgrade any errors from inability to toggle the SKIP_WORKTREE bit to a
warning and allow the operations to continue.
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-27 03:49:00 +03:00
|
|
|
test_expect_success 'print warnings when some worktree updates disabled' '
|
2011-09-22 15:24:22 +04:00
|
|
|
echo sub >.git/info/sparse-checkout &&
|
|
|
|
git checkout -f init &&
|
|
|
|
mkdir sub &&
|
|
|
|
touch sub/added sub/addedtoo &&
|
unpack-trees: failure to set SKIP_WORKTREE bits always just a warning
Setting and clearing of the SKIP_WORKTREE bit is not only done when
users run 'sparse-checkout'; other commands such as 'checkout' also run
through unpack_trees() which has logic for handling this special bit.
As such, we need to consider how they handle special cases. A couple
comparison points should help explain the rationale for changing how
unpack_trees() handles these bits:
Ignoring sparse checkouts for a moment, if you are switching
branches and have dirty changes, it is only considered an error that
will prevent the branch switching from being successful if the dirty
file happens to be one of the paths with different contents.
SKIP_WORKTREE has always been considered advisory; for example, if
rebase or merge need or even want to materialize a path as part of
their work, they have always been allowed to do so regardless of the
SKIP_WORKTREE setting. This has been used for unmerged paths, but
it was often used for paths it wasn't needed just because it made
the code simpler. It was a best-effort consideration, and when it
materialized paths contrary to the SKIP_WORKTREE setting, it was
never required to even print a warning message.
In the past if you trying to run e.g. 'git checkout' and:
1) you had a path that was materialized and had some dirty changes
2) the path was listed in $GITDIR/info/sparse-checkout
3) this path did not different between the current and target branches
then despite the comparison points above, the inability to set
SKIP_WORKTREE was treated as a *hard* error that would abort the
checkout operation. This is completely inconsistent with how
SKIP_WORKTREE is handled elsewhere, and rather annoying for users as
leaving the paths materialized in the working copy (with a simple
warning) should present no problem at all.
Downgrade any errors from inability to toggle the SKIP_WORKTREE bit to a
warning and allow the operations to continue.
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-27 03:49:00 +03:00
|
|
|
# Use -q to suppress "Previous HEAD position" and "Head is now at" msgs
|
|
|
|
git checkout -q top 2>actual &&
|
2011-09-22 15:24:22 +04:00
|
|
|
cat >expected <<\EOF &&
|
unpack-trees: failure to set SKIP_WORKTREE bits always just a warning
Setting and clearing of the SKIP_WORKTREE bit is not only done when
users run 'sparse-checkout'; other commands such as 'checkout' also run
through unpack_trees() which has logic for handling this special bit.
As such, we need to consider how they handle special cases. A couple
comparison points should help explain the rationale for changing how
unpack_trees() handles these bits:
Ignoring sparse checkouts for a moment, if you are switching
branches and have dirty changes, it is only considered an error that
will prevent the branch switching from being successful if the dirty
file happens to be one of the paths with different contents.
SKIP_WORKTREE has always been considered advisory; for example, if
rebase or merge need or even want to materialize a path as part of
their work, they have always been allowed to do so regardless of the
SKIP_WORKTREE setting. This has been used for unmerged paths, but
it was often used for paths it wasn't needed just because it made
the code simpler. It was a best-effort consideration, and when it
materialized paths contrary to the SKIP_WORKTREE setting, it was
never required to even print a warning message.
In the past if you trying to run e.g. 'git checkout' and:
1) you had a path that was materialized and had some dirty changes
2) the path was listed in $GITDIR/info/sparse-checkout
3) this path did not different between the current and target branches
then despite the comparison points above, the inability to set
SKIP_WORKTREE was treated as a *hard* error that would abort the
checkout operation. This is completely inconsistent with how
SKIP_WORKTREE is handled elsewhere, and rather annoying for users as
leaving the paths materialized in the working copy (with a simple
warning) should present no problem at all.
Downgrade any errors from inability to toggle the SKIP_WORKTREE bit to a
warning and allow the operations to continue.
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-27 03:49:00 +03:00
|
|
|
warning: The following paths were already present and thus not updated despite sparse patterns:
|
2011-09-22 15:24:22 +04:00
|
|
|
sub/added
|
|
|
|
sub/addedtoo
|
unpack-trees: failure to set SKIP_WORKTREE bits always just a warning
Setting and clearing of the SKIP_WORKTREE bit is not only done when
users run 'sparse-checkout'; other commands such as 'checkout' also run
through unpack_trees() which has logic for handling this special bit.
As such, we need to consider how they handle special cases. A couple
comparison points should help explain the rationale for changing how
unpack_trees() handles these bits:
Ignoring sparse checkouts for a moment, if you are switching
branches and have dirty changes, it is only considered an error that
will prevent the branch switching from being successful if the dirty
file happens to be one of the paths with different contents.
SKIP_WORKTREE has always been considered advisory; for example, if
rebase or merge need or even want to materialize a path as part of
their work, they have always been allowed to do so regardless of the
SKIP_WORKTREE setting. This has been used for unmerged paths, but
it was often used for paths it wasn't needed just because it made
the code simpler. It was a best-effort consideration, and when it
materialized paths contrary to the SKIP_WORKTREE setting, it was
never required to even print a warning message.
In the past if you trying to run e.g. 'git checkout' and:
1) you had a path that was materialized and had some dirty changes
2) the path was listed in $GITDIR/info/sparse-checkout
3) this path did not different between the current and target branches
then despite the comparison points above, the inability to set
SKIP_WORKTREE was treated as a *hard* error that would abort the
checkout operation. This is completely inconsistent with how
SKIP_WORKTREE is handled elsewhere, and rather annoying for users as
leaving the paths materialized in the working copy (with a simple
warning) should present no problem at all.
Downgrade any errors from inability to toggle the SKIP_WORKTREE bit to a
warning and allow the operations to continue.
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-27 03:49:00 +03:00
|
|
|
|
|
|
|
After fixing the above paths, you may want to run `git sparse-checkout reapply`.
|
2011-09-22 15:24:22 +04:00
|
|
|
EOF
|
2021-02-11 04:53:53 +03:00
|
|
|
test_cmp expected actual
|
2011-09-22 15:24:22 +04:00
|
|
|
'
|
|
|
|
|
2013-04-13 03:12:08 +04:00
|
|
|
test_expect_success 'checkout without --ignore-skip-worktree-bits' '
|
|
|
|
echo "*" >.git/info/sparse-checkout &&
|
|
|
|
git checkout -f top &&
|
|
|
|
test_path_is_file init.t &&
|
|
|
|
echo sub >.git/info/sparse-checkout &&
|
|
|
|
git checkout &&
|
|
|
|
echo modified >> sub/added &&
|
|
|
|
git checkout . &&
|
|
|
|
test_path_is_missing init.t &&
|
|
|
|
git diff --exit-code HEAD
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'checkout with --ignore-skip-worktree-bits' '
|
|
|
|
echo "*" >.git/info/sparse-checkout &&
|
|
|
|
git checkout -f top &&
|
|
|
|
test_path_is_file init.t &&
|
|
|
|
echo sub >.git/info/sparse-checkout &&
|
|
|
|
git checkout &&
|
|
|
|
echo modified >> sub/added &&
|
|
|
|
git checkout --ignore-skip-worktree-bits . &&
|
|
|
|
test_path_is_file init.t &&
|
|
|
|
git diff --exit-code HEAD
|
|
|
|
'
|
|
|
|
|
2009-08-20 17:47:12 +04:00
|
|
|
test_done
|