t0021: test application of both crlf and ident
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
May 24, 2011 at 18:02 UTC
6b6cab3f9af2ab7010592e50bb343b990a6a7666
1 file changed
+24
-8
t/t0021-conversion.sh
+24
-8
@@ -66,10 +66,14 @@ test_expect_success expanded_in_repo '
66
echo "\$Id:NoSpaceAtEitherEnd\$"
67
echo "\$Id: NoTerminatingSymbol"
68
echo "\$Id: Foreign Commit With Spaces \$"
69
- printf "\$Id: NoTerminatingSymbolAtEOF"
70
- } > expanded-keywords &&
69
+ } >expanded-keywords.0 &&
70
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 &&
77
git commit -m "File with keywords expanded" &&
78
id=$(git rev-parse --verify :expanded-keywords) &&
79
@@ -83,15 +87,27 @@ test_expect_success expanded_in_repo '
87
echo "\$Id: $id \$"
88
echo "\$Id: NoTerminatingSymbol"
89
echo "\$Id: Foreign Commit With Spaces \$"
90
+ } >expected-output.0 &&
91
+ {
92
+ cat expected-output.0 &&
93
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 &&
103
89
- echo "expanded-keywords ident" >> .gitattributes &&
104
+ rm -f expanded-keywords expanded-keywords-crlf &&
105
91
- rm -f expanded-keywords &&
106
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
111
'
112
113
# The use of %f in a filter definition is expanded to the path to