summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d347cee)
raw | patch | inline | side by side (parent: d347cee)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Thu, 5 Aug 2010 11:13:04 +0000 (06:13 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 6 Aug 2010 16:20:00 +0000 (09:20 -0700) |
An unusual sort of person (not me) may even enjoy the conflicts
from line-ending changes. But more importantly, it is useful to
document that behavior so we can more easily notice if it changes
in an uncontrolled way while no one is watching.
Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
from line-ending changes. But more importantly, it is useful to
document that behavior so we can more easily notice if it changes
in an uncontrolled way while no one is watching.
Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6038-merge-text-auto.sh | patch | blob | history |
index a7ea4b626b553d5563207b95fbd10afdae47002c..52d0dc4bb8f80393c79935f9c951b5323287e41c 100755 (executable)
. ./test-lib.sh
test_expect_success setup '
- git config merge.renormalize true &&
git config core.autocrlf false &&
echo first line | append_cr >file &&
git checkout master
'
+test_expect_success 'set up fuzz_conflict() helper' '
+ fuzz_conflict() {
+ sed -e "s/^\([<>=]......\) .*/\1/" "$@"
+ }
+'
+
test_expect_success 'Merge after setting text=auto' '
cat <<-\EOF >expected &&
first line
same line
EOF
+ git config merge.renormalize true &&
git rm -fr . &&
rm -f .gitattributes &&
git reset --hard a &&
same line
EOF
+ git config merge.renormalize true &&
git rm -fr . &&
rm -f .gitattributes &&
git reset --hard b &&
test_cmp expected file
'
+test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '
+ q_to_cr <<-\EOF >expected &&
+ <<<<<<<
+ first line
+ same line
+ =======
+ first lineQ
+ same lineQ
+ >>>>>>>
+ EOF
+
+ git config merge.renormalize false &&
+ rm -f .gitattributes &&
+ git reset --hard a &&
+ test_must_fail git merge b &&
+ fuzz_conflict file >file.fuzzy &&
+ test_cmp expected file.fuzzy
+'
+
+test_expect_success 'Detect LF/CRLF conflict from addition of text=auto' '
+ q_to_cr <<-\EOF >expected &&
+ <<<<<<<
+ first lineQ
+ same lineQ
+ =======
+ first line
+ same line
+ >>>>>>>
+ EOF
+
+ git config merge.renormalize false &&
+ rm -f .gitattributes &&
+ git reset --hard b &&
+ test_must_fail git merge a &&
+ fuzz_conflict file >file.fuzzy &&
+ test_cmp expected file.fuzzy
+'
+
test_expect_failure 'checkout -m after setting text=auto' '
cat <<-\EOF >expected &&
first line
same line
EOF
+ git config merge.renormalize true &&
git rm -fr . &&
rm -f .gitattributes &&
git reset --hard initial &&
same line
EOF
+ git config merge.renormalize true &&
git rm -fr . &&
rm -f .gitattributes file &&
git reset --hard initial &&
same line
EOF
+ git config merge.renormalize true &&
git rm -fr . &&
git reset --hard b &&
test_must_fail git cherry-pick a >err 2>&1 &&