Git fork

t/lib-chunk: work around broken "mv" on some vintage of macOS

When the destination is read-only, "mv" on some version of macOS
asks whether to replace the destination even though in the test its
stdin is not a terminal (and thus doesn't conform to POSIX[1]).

The helper to corrupt a chunk-file is designed to work on the
files like commit-graph and multi-pack-index files that are
generally read-only, so use "mv -f" to work around this issue.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

+2 -1
+2 -1
t/lib-chunk.sh
··· 13 13 fn=$1; shift 14 14 perl "$TEST_DIRECTORY"/lib-chunk/corrupt-chunk-file.pl \ 15 15 "$@" <"$fn" >"$fn.tmp" && 16 - mv "$fn.tmp" "$fn" 16 + # some vintages of macOS 'mv' fails to overwrite a read-only file. 17 + mv -f "$fn.tmp" "$fn" 17 18 }