summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorAndy Parkins <andyparkins@gmail.com>2007-05-27 10:52:11 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-05-29 06:54:35 (GMT)
commitdfab71cb923d031715ebc3cf9f920d801250c552 (patch)
tree909ff942bbc62d261ca4fd5a5d2e19e9d7c05539 /t
parentcdd5b82ee8e6941eee9c7b09df63c44789fd5c4b (diff)
downloadgit-dfab71cb923d031715ebc3cf9f920d801250c552.zip
git-dfab71cb923d031715ebc3cf9f920d801250c552.tar.gz
git-dfab71cb923d031715ebc3cf9f920d801250c552.tar.bz2
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t0021-conversion.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 6c26fd8..a839f4e 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -45,4 +45,40 @@ test_expect_success check '
test "z$id" = "z$embedded"
'
+# If an expanded ident ever gets into the repository, we want to make sure that
+# it is collapsed before being expanded again on checkout
+test_expect_success expanded_in_repo '
+ {
+ echo "File with expanded keywords"
+ echo "\$Id\$"
+ echo "\$Id:\$"
+ echo "\$Id: 0000000000000000000000000000000000000000 \$"
+ echo "\$Id: NoSpaceAtEnd\$"
+ echo "\$Id:NoSpaceAtFront \$"
+ echo "\$Id:NoSpaceAtEitherEnd\$"
+ echo "\$Id: NoTerminatingSymbol"
+ } > expanded-keywords &&
+
+ {
+ echo "File with expanded keywords"
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
+ echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
+ echo "\$Id: NoTerminatingSymbol"
+ } > expected-output &&
+
+ git add expanded-keywords &&
+ git commit -m "File with keywords expanded" &&
+
+ echo "expanded-keywords ident" >> .gitattributes &&
+
+ rm -f expanded-keywords &&
+ git checkout -- expanded-keywords &&
+ cat expanded-keywords &&
+ cmp expanded-keywords expected-output
+'
+
test_done