Add test case for $Id$ expanded in the repository
This test case would have caught the bug fixed by revision c23290d5. It puts various forms of $Id$ into a file in the repository, without allowing git to collapse them to uniformity. Then enables the $Id$ expansion on checkout, and checks that what is checked out has coped with the various forms. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Andy Parkins committed
May 27, 2007 at 11:52 UTC
dfab71cb923d031715ebc3cf9f920d801250c552
1 file changed
+36
t/t0021-conversion.sh
+36
@@ -45,4 +45,40 @@ test_expect_success check '
45
test "z$id" = "z$embedded"
46
'
47
48
+# If an expanded ident ever gets into the repository, we want to make sure that
49
+# it is collapsed before being expanded again on checkout
50
+test_expect_success expanded_in_repo '
51
+ {
52
+ echo "File with expanded keywords"
53
+ echo "\$Id\$"
54
+ echo "\$Id:\$"
55
+ echo "\$Id: 0000000000000000000000000000000000000000 \$"
56
+ echo "\$Id: NoSpaceAtEnd\$"
57
+ echo "\$Id:NoSpaceAtFront \$"
58
+ echo "\$Id:NoSpaceAtEitherEnd\$"
59
+ echo "\$Id: NoTerminatingSymbol"
60
+ } > expanded-keywords &&
61
+
62
+ {
63
+ echo "File with expanded keywords"
64
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
65
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
66
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
67
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
68
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
69
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
70
+ echo "\$Id: NoTerminatingSymbol"
71
+ } > expected-output &&
72
+
73
+ git add expanded-keywords &&
74
+ git commit -m "File with keywords expanded" &&
75
+
76
+ echo "expanded-keywords ident" >> .gitattributes &&
77
+
78
+ rm -f expanded-keywords &&
79
+ git checkout -- expanded-keywords &&
80
+ cat expanded-keywords &&
81
+ cmp expanded-keywords expected-output
82
+'
83
+
84
test_done