Skip to content

Commit d347cee

Browse files
jrngitster
authored andcommitted
t6038 (merge.renormalize): try checkout -m and cherry-pick
checkout -m and cherry-pick have not been wired up to respect merge.renormalize, but a naïve user would not know that. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 18acb30 commit d347cee

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

t/t6038-merge-text-auto.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,47 @@ test_expect_success 'Merge addition of text=auto' '
8585
test_cmp expected file
8686
'
8787

88+
test_expect_failure 'checkout -m after setting text=auto' '
89+
cat <<-\EOF >expected &&
90+
first line
91+
same line
92+
EOF
93+
94+
git rm -fr . &&
95+
rm -f .gitattributes &&
96+
git reset --hard initial &&
97+
git checkout a -- . &&
98+
git checkout -m b &&
99+
test_cmp expected file
100+
'
101+
102+
test_expect_failure 'checkout -m addition of text=auto' '
103+
cat <<-\EOF >expected &&
104+
first line
105+
same line
106+
EOF
107+
108+
git rm -fr . &&
109+
rm -f .gitattributes file &&
110+
git reset --hard initial &&
111+
git checkout b -- . &&
112+
git checkout -m a &&
113+
test_cmp expected file
114+
'
115+
116+
test_expect_failure 'cherry-pick patch from after text=auto was added' '
117+
append_cr <<-\EOF >expected &&
118+
first line
119+
same line
120+
EOF
121+
122+
git rm -fr . &&
123+
git reset --hard b &&
124+
test_must_fail git cherry-pick a >err 2>&1 &&
125+
grep "[Nn]othing added" err &&
126+
test_cmp expected file
127+
'
128+
88129
test_expect_success 'Test delete/normalize conflict' '
89130
git checkout -f side &&
90131
git rm -fr . &&

0 commit comments

Comments
 (0)