Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaoxuan Yuan <shaoxuan.yuan02@gmail.com>2022-06-30 05:37:37 +0300
committerJunio C Hamano <gitster@pobox.com>2022-07-02 00:50:16 +0300
commitb91a2b6594a1da7d4d2f936f7db25bfa5a3d775e (patch)
treea5f8f4c59962739e6dc3cf784fe4cebafae4fbc8 /t/t1092-sparse-checkout-compatibility.sh
parent24ea81d9ac401731c222b28097b339aa0d2d316d (diff)
mv: add check_dir_in_index() and solve general dir check issue
Originally, moving a <source> directory which is not on-disk due to its existence outside of sparse-checkout cone, "giv mv" command errors out with "bad source". Add a helper check_dir_in_index() function to see if a directory name exists in the index. Also add a SKIP_WORKTREE_DIR bit to mark such directories. Change the checking logic, so that such <source> directory makes "giv mv" command warns with "advise_on_updating_sparse_paths()" instead of "bad source"; also user now can supply a "--sparse" flag so this operation can be carried out successfully. Helped-by: Victoria Dye <vdye@github.com> Helped-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> Acked-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1092-sparse-checkout-compatibility.sh')
-rwxr-xr-xt/t1092-sparse-checkout-compatibility.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh
index 5eef799e25..763c6cc684 100755
--- a/t/t1092-sparse-checkout-compatibility.sh
+++ b/t/t1092-sparse-checkout-compatibility.sh
@@ -1828,7 +1828,7 @@ test_expect_success 'checkout behaves oddly with df-conflict-2' '
test_cmp full-checkout-err sparse-index-err
'
-test_expect_failure 'mv directory from out-of-cone to in-cone' '
+test_expect_success 'mv directory from out-of-cone to in-cone' '
init_repos &&
# <source> as a sparse directory (or SKIP_WORKTREE_DIR without enabling