summaryrefslogtreecommitdiff
path: root/t/t9803-git-p4-shell-metachars.sh
diff options
context:
space:
mode:
authorLuke Diamand <luke@diamand.org>2012-01-19 09:52:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-01-20 22:47:23 (GMT)
commit52a4880bcda7780eeda5a884f73ffa83726dc982 (patch)
tree2d5fe118da2d389c81e27b5e2fd3711fdf9d8484 /t/t9803-git-p4-shell-metachars.sh
parent8cbfc1189cfc23f96f797a64bcb0c050b6ecc6e6 (diff)
downloadgit-52a4880bcda7780eeda5a884f73ffa83726dc982.zip
git-52a4880bcda7780eeda5a884f73ffa83726dc982.tar.gz
git-52a4880bcda7780eeda5a884f73ffa83726dc982.tar.bz2
git-p4: handle p4 branches and labels containing shell chars
Don't use shell expansion when detecting branches, as it will fail if the branch name contains a shell metachar. Similarly for labels. Add additional test for branches with shell metachars. Signed-off-by: Luke Diamand <luke@diamand.org> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9803-git-p4-shell-metachars.sh')
-rwxr-xr-xt/t9803-git-p4-shell-metachars.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/t/t9803-git-p4-shell-metachars.sh b/t/t9803-git-p4-shell-metachars.sh
index db04375..db67020 100755
--- a/t/t9803-git-p4-shell-metachars.sh
+++ b/t/t9803-git-p4-shell-metachars.sh
@@ -57,6 +57,54 @@ test_expect_success 'deleting with shell metachars' '
)
'
+# Create a branch with a shell metachar in its name
+#
+# 1. //depot/main
+# 2. //depot/branch$3
+
+test_expect_success 'branch with shell char' '
+ test_when_finished cleanup_git &&
+ test_create_repo "$git" &&
+ (
+ cd "$cli" &&
+
+ mkdir -p main &&
+
+ echo f1 >main/f1 &&
+ p4 add main/f1 &&
+ p4 submit -d "main/f1" &&
+
+ p4 integrate //depot/main/... //depot/branch\$3/... &&
+ p4 submit -d "integrate main to branch\$3" &&
+
+ echo f1 >branch\$3/shell_char_branch_file &&
+ p4 add branch\$3/shell_char_branch_file &&
+ p4 submit -d "branch\$3/shell_char_branch_file" &&
+
+ p4 branch -i <<-EOF &&
+ Branch: branch\$3
+ View: //depot/main/... //depot/branch\$3/...
+ EOF
+
+ p4 edit main/f1 &&
+ echo "a change" >> main/f1 &&
+ p4 submit -d "a change" main/f1 &&
+
+ p4 integrate -b branch\$3 &&
+ p4 resolve -am branch\$3/... &&
+ p4 submit -d "integrate main to branch\$3" &&
+
+ cd "$git" &&
+
+ git config git-p4.branchList main:branch\$3 &&
+ "$GITP4" clone --dest=. --detect-branches //depot@all &&
+ git log --all --graph --decorate --stat &&
+ git reset --hard p4/depot/branch\$3 &&
+ test -f shell_char_branch_file &&
+ test -f f1
+ )
+'
+
test_expect_success 'kill p4d' '
kill_p4d
'