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:
authorJeff King <peff@peff.net>2017-01-24 16:27:49 +0300
committerJunio C Hamano <gitster@pobox.com>2017-01-25 23:32:32 +0300
commitc20d4d702f13e6bd4e4c8757989bed62a75e2cfa (patch)
treef03fd31ea3b690eadf21e768f8c98481d4c22875 /t/t1450-fsck.sh
parentc2d17b3b6ef42b20b9da294a7a920491b907c503 (diff)
t1450: use "mv -f" within loose object directory
The loose objects are created with mode 0444. That doesn't prevent them being overwritten by rename(), but some versions of "mv" will be extra careful and prompt the user, even without "-i". Reportedly macOS does this, at least in the Travis builds. The prompt reads from /dev/null, defaulting to "no", and the object isn't moved. Then to make matters even more interesting, it still returns "0" and the rest of the test proceeds, but with a broken setup. We can work around it by using "mv -f" to override the prompt. This should work as it's already used in t5504 for the same purpose. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1450-fsck.sh')
-rwxr-xr-xt/t1450-fsck.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 509d69c90e..d9cd99f2cb 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -536,7 +536,7 @@ test_expect_success 'fsck --connectivity-only' '
# free to examine the type if it chooses.
empty=.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&
blob=$(echo unrelated | git hash-object -w --stdin) &&
- mv $(sha1_file $blob) $empty &&
+ mv -f $(sha1_file $blob) $empty &&
test_must_fail git fsck --strict &&
git fsck --strict --connectivity-only &&