aboutsummaryrefslogtreecommitdiff
path: root/t/t9810-git-p4-rcs.sh
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2012-11-04 17:04:02 -0500
committerJeff King <peff@peff.net>2012-11-08 12:46:14 -0500
commit6b2bf41e6c1c9742c5ad5b5920f48a7b23aa6a50 (patch)
treeaac1a6d862433fb4f4a1a7e93d4ec8eb842e71ee /t/t9810-git-p4-rcs.sh
parent7e2010537e96d0a1144520222f20ba1dc3d61441 (diff)
downloadgit-6b2bf41e6c1c9742c5ad5b5920f48a7b23aa6a50.tar.gz
git-6b2bf41e6c1c9742c5ad5b5920f48a7b23aa6a50.tar.xz
git p4: RCS expansion should not span newlines
This bug was introduced in cb585a9 (git-p4: keyword flattening fixes, 2011-10-16). The newline character is indeed special, and $File$ expansions should not try to match across multiple lines. Based-on-patch-by: Chris Goard <cgoard@gmail.com> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 't/t9810-git-p4-rcs.sh')
-rwxr-xr-xt/t9810-git-p4-rcs.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t9810-git-p4-rcs.sh b/t/t9810-git-p4-rcs.sh
index e9daa9c4f..12b3d8144 100755
--- a/t/t9810-git-p4-rcs.sh
+++ b/t/t9810-git-p4-rcs.sh
@@ -155,6 +155,25 @@ test_expect_success 'cleanup after failure' '
)
'
+# perl $File:: bug check
+test_expect_success 'ktext expansion should not expand multi-line $File::' '
+ (
+ cd "$cli" &&
+ cat >lv.pm <<-\EOF
+ my $wanted = sub { my $f = $File::Find::name;
+ if ( -f && $f =~ /foo/ ) {
+ EOF
+ p4 add -t ktext lv.pm &&
+ p4 submit -d "lv.pm"
+ ) &&
+ test_when_finished cleanup_git &&
+ git p4 clone --dest="$git" //depot &&
+ (
+ cd "$git" &&
+ test_cmp "$cli/lv.pm" lv.pm
+ )
+'
+
#
# Do not scrub anything but +k or +ko files. Sneak a change into
# the cli file so that submit will get a conflict. Make sure that