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:
authorDenton Liu <liu.denton@gmail.com>2019-12-20 21:15:59 +0300
committerJunio C Hamano <gitster@pobox.com>2019-12-20 22:30:45 +0300
commit10812c2337eb04f2857000fd644efdc02247ca92 (patch)
tree5d60d4a2dc3c9df1dd72d56a94bd4aa3b3a3e316 /t/t1501-work-tree.sh
parent62d58cda69621eb2f70517c87f1baeeb7b2f398c (diff)
t1501: remove use of `test_might_fail cp`
The test_must_fail() family of functions (including test_might_fail()) should only be used on git commands. Replace test_might_fail() with a compound command wrapping the old cp invocation that always returns 0. The `test_might_fail cp` line was introduced in 466e8d5d66 (t1501: fix test with split index, 2015-03-24). It is necessary because there might exist some index files in `repo.git/sharedindex.*` and, if they exist, we want to copy them over. However, if they don't exist, we don't want to error out because we expect that possibility. As a result, we want to keep the "might fail" semantics so we always return 0, even if the underlying cp errors out. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1501-work-tree.sh')
-rwxr-xr-xt/t1501-work-tree.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh
index 3498d3d55e..b75558040f 100755
--- a/t/t1501-work-tree.sh
+++ b/t/t1501-work-tree.sh
@@ -350,7 +350,7 @@ test_expect_success 'Multi-worktree setup' '
mkdir work &&
mkdir -p repo.git/repos/foo &&
cp repo.git/HEAD repo.git/index repo.git/repos/foo &&
- test_might_fail cp repo.git/sharedindex.* repo.git/repos/foo &&
+ { cp repo.git/sharedindex.* repo.git/repos/foo || :; } &&
sane_unset GIT_DIR GIT_CONFIG GIT_WORK_TREE
'