summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2016-04-25 18:56:27 +0200
committerJunio C Hamano <gitster@pobox.com>2016-04-25 12:10:48 -0700
commitded2444ad8ab8128cae2b91b8efa57ea2dd8c7a5 (patch)
treed580695a93c81ffe920ce3c062739a4d62a17573 /t
parent90f7b16b3adc78d4bbabbd426fb69aa78c714f71 (diff)
downloadgit-ded2444ad8ab8128cae2b91b8efa57ea2dd8c7a5.tar.gz
t0027: make commit_chk_wrnNNO() reliable
When the content of a commited file is unchanged and the attributes are changed, Git may not detect that the next commit must treat the file as changed. This happens when lstat() doesn't detect a change, since neither inode, mtime nor size are changed. Add a single "Z" character to change the file size and content. When the files are compared later in checkout_files(), the "Z" is removed before the comparison. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t0027-auto-crlf.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index f33962b178..9fe539b13d 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -12,7 +12,7 @@ fi
compare_files () {
tr '\015\000' QN <"$1" >"$1".expect &&
- tr '\015\000' QN <"$2" >"$2".actual &&
+ tr '\015\000' QN <"$2" | tr -d 'Z' >"$2".actual &&
test_cmp "$1".expect "$2".actual &&
rm "$1".expect "$2".actual
}
@@ -114,6 +114,7 @@ commit_chk_wrnNNO () {
do
fname=${pfx}_$f.txt &&
cp $f $fname &&
+ printf Z >>"$fname" &&
git -c core.autocrlf=$crlf add $fname 2>/dev/null &&
git -c core.autocrlf=$crlf commit -m "commit_$fname" $fname >"${pfx}_$f.err" 2>&1
done