Skip to content

Commit 6b6cab3

Browse files
committed
t0021: test application of both crlf and ident
Signed-off-by: Junio C Hamano <[email protected]>
1 parent dd555d8 commit 6b6cab3

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

t/t0021-conversion.sh

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ test_expect_success expanded_in_repo '
6666
echo "\$Id:NoSpaceAtEitherEnd\$"
6767
echo "\$Id: NoTerminatingSymbol"
6868
echo "\$Id: Foreign Commit With Spaces \$"
69-
printf "\$Id: NoTerminatingSymbolAtEOF"
70-
} > expanded-keywords &&
69+
} >expanded-keywords.0 &&
7170
72-
git add expanded-keywords &&
71+
{
72+
cat expanded-keywords.0 &&
73+
printf "\$Id: NoTerminatingSymbolAtEOF"
74+
} >expanded-keywords &&
75+
cat expanded-keywords >expanded-keywords-crlf &&
76+
git add expanded-keywords expanded-keywords-crlf &&
7377
git commit -m "File with keywords expanded" &&
7478
id=$(git rev-parse --verify :expanded-keywords) &&
7579
@@ -83,15 +87,27 @@ test_expect_success expanded_in_repo '
8387
echo "\$Id: $id \$"
8488
echo "\$Id: NoTerminatingSymbol"
8589
echo "\$Id: Foreign Commit With Spaces \$"
90+
} >expected-output.0 &&
91+
{
92+
cat expected-output.0 &&
8693
printf "\$Id: NoTerminatingSymbolAtEOF"
87-
} > expected-output &&
94+
} >expected-output &&
95+
{
96+
append_cr <expected-output.0 &&
97+
printf "\$Id: NoTerminatingSymbolAtEOF"
98+
} >expected-output-crlf &&
99+
{
100+
echo "expanded-keywords ident"
101+
echo "expanded-keywords-crlf ident text eol=crlf"
102+
} >>.gitattributes &&
88103
89-
echo "expanded-keywords ident" >> .gitattributes &&
104+
rm -f expanded-keywords expanded-keywords-crlf &&
90105
91-
rm -f expanded-keywords &&
92106
git checkout -- expanded-keywords &&
93-
cat expanded-keywords &&
94-
cmp expanded-keywords expected-output
107+
test_cmp expanded-keywords expected-output &&
108+
109+
git checkout -- expanded-keywords-crlf &&
110+
test_cmp expanded-keywords-crlf expected-output-crlf
95111
'
96112

97113
# The use of %f in a filter definition is expanded to the path to

0 commit comments

Comments
 (0)