summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-12-19 22:45:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-12-19 22:45:37 (GMT)
commit101f3dc92a4cedb1f359f6ddce913b631ffa75b6 (patch)
tree4a2a080defff5758fff445e3d31901138be81968 /t
parent09b4fdb5f396612dd50236ae5395a74600d2ab84 (diff)
parent378f7be1e74661ff1480cc44a5f039ef85da7288 (diff)
downloadgit-101f3dc92a4cedb1f359f6ddce913b631ffa75b6.zip
git-101f3dc92a4cedb1f359f6ddce913b631ffa75b6.tar.gz
git-101f3dc92a4cedb1f359f6ddce913b631ffa75b6.tar.bz2
Merge branch 'ld/p4-worktree'
"git p4" didn't interact with the internal of .git directory correctly in the modern "git-worktree"-enabled world. * ld/p4-worktree: git-p4: support git worktrees
Diffstat (limited to 't')
-rwxr-xr-xt/t9800-git-p4-basic.sh20
-rwxr-xr-xt/t9806-git-p4-options.sh32
2 files changed, 52 insertions, 0 deletions
diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh
index 0730f18..093e9bd 100755
--- a/t/t9800-git-p4-basic.sh
+++ b/t/t9800-git-p4-basic.sh
@@ -257,6 +257,26 @@ test_expect_success 'submit from detached head' '
)
'
+test_expect_success 'submit from worktree' '
+ test_when_finished cleanup_git &&
+ git p4 clone --dest="$git" //depot &&
+ (
+ cd "$git" &&
+ git worktree add ../worktree-test
+ ) &&
+ (
+ cd "$git/../worktree-test" &&
+ test_commit "worktree-commit" &&
+ git config git-p4.skipSubmitEdit true &&
+ git p4 submit
+ ) &&
+ (
+ cd "$cli" &&
+ p4 sync &&
+ test_path_is_file worktree-commit.t
+ )
+'
+
test_expect_success 'kill p4d' '
kill_p4d
'
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index 254d428..1ab76c4 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -269,6 +269,38 @@ test_expect_success 'submit works with two branches' '
)
'
+test_expect_success 'use --git-dir option and GIT_DIR' '
+ test_when_finished cleanup_git &&
+ git p4 clone //depot --destination="$git" &&
+ (
+ cd "$git" &&
+ git config git-p4.skipSubmitEdit true &&
+ test_commit first-change &&
+ git p4 submit --git-dir "$git"
+ ) &&
+ (
+ cd "$cli" &&
+ p4 sync &&
+ test_path_is_file first-change.t &&
+ echo "cli_file" >cli_file.t &&
+ p4 add cli_file.t &&
+ p4 submit -d "cli change"
+ ) &&
+ (git --git-dir "$git" p4 sync) &&
+ (cd "$git" && git checkout -q p4/master) &&
+ test_path_is_file "$git"/cli_file.t &&
+ (
+ cd "$cli" &&
+ echo "cli_file2" >cli_file2.t &&
+ p4 add cli_file2.t &&
+ p4 submit -d "cli change2"
+ ) &&
+ (GIT_DIR="$git" git p4 sync) &&
+ (cd "$git" && git checkout -q p4/master) &&
+ test_path_is_file "$git"/cli_file2.t
+'
+
+
test_expect_success 'kill p4d' '
kill_p4d
'