@@ -66,10 +66,14 @@ test_expect_success expanded_in_repo '
66
66
echo "\$Id:NoSpaceAtEitherEnd\$"
67
67
echo "\$Id: NoTerminatingSymbol"
68
68
echo "\$Id: Foreign Commit With Spaces \$"
69
- printf "\$Id: NoTerminatingSymbolAtEOF"
70
- } > expanded-keywords &&
69
+ } >expanded-keywords.0 &&
71
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 &&
73
77
git commit -m "File with keywords expanded" &&
74
78
id=$(git rev-parse --verify :expanded-keywords) &&
75
79
@@ -83,15 +87,27 @@ test_expect_success expanded_in_repo '
83
87
echo "\$Id: $id \$"
84
88
echo "\$Id: NoTerminatingSymbol"
85
89
echo "\$Id: Foreign Commit With Spaces \$"
90
+ } >expected-output.0 &&
91
+ {
92
+ cat expected-output.0 &&
86
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 &&
88
103
89
- echo " expanded-keywords ident" >> .gitattributes &&
104
+ rm -f expanded-keywords expanded-keywords-crlf &&
90
105
91
- rm -f expanded-keywords &&
92
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
95
111
'
96
112
97
113
# The use of %f in a filter definition is expanded to the path to
0 commit comments