Skip to content

Commit 9aa7c16

Browse files
Pete Wyckoffgitster
authored andcommitted
git-p4: simple branch tests edits
More review comments. Signed-off-by: Pete Wyckoff <[email protected]> Signed-off-by: Vitor Antunes <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7ca97f6 commit 9aa7c16

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

t/t9800-git-p4.sh

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ test_expect_success 'add simple p4 branches' '
413413
cd branch1 &&
414414
echo file1 >file1 &&
415415
echo file2 >file2 &&
416-
p4 add file* &&
416+
p4 add file1 file2 &&
417417
p4 submit -d "branch1" &&
418418
p4 integrate //depot/branch1/... //depot/branch2/... &&
419419
p4 submit -d "branch2" &&
@@ -433,13 +433,12 @@ test_expect_success 'add simple p4 branches' '
433433
# Finally, make an update to branch1 on P4 side to check if it is imported
434434
# correctly by git-p4.
435435
test_expect_success 'git-p4 clone simple branches' '
436-
git init "$git" &&
436+
test_when_finished cleanup_git &&
437+
test_create_repo "$git" &&
437438
cd "$git" &&
438439
git config git-p4.branchList branch1:branch2 &&
439440
git config --add git-p4.branchList branch1:branch3 &&
440-
cd "$TRASH_DIRECTORY" &&
441-
"$GITP4" clone --dest="$git" --detect-branches //depot@all &&
442-
cd "$git" &&
441+
"$GITP4" clone --dest=. --detect-branches //depot@all &&
443442
git log --all --graph --decorate --stat &&
444443
git reset --hard p4/depot/branch1 &&
445444
test -f file1 &&
@@ -449,7 +448,7 @@ test_expect_success 'git-p4 clone simple branches' '
449448
git reset --hard p4/depot/branch2 &&
450449
test -f file1 &&
451450
test -f file2 &&
452-
test \! -z file3 &&
451+
test ! -f file3 &&
453452
! grep -q update file2 &&
454453
git reset --hard p4/depot/branch3 &&
455454
test -f file1 &&
@@ -459,14 +458,12 @@ test_expect_success 'git-p4 clone simple branches' '
459458
cd "$cli" &&
460459
cd branch1 &&
461460
p4 edit file2 &&
462-
echo file2_ >> file2 &&
463-
p4 submit -d "update file2 in branch3" &&
461+
echo file2_ >>file2 &&
462+
p4 submit -d "update file2 in branch1" &&
464463
cd "$git" &&
465464
git reset --hard p4/depot/branch1 &&
466465
"$GITP4" rebase &&
467-
grep -q file2_ file2 &&
468-
cd "$TRASH_DIRECTORY" &&
469-
rm -rf "$git" && mkdir "$git"
466+
grep -q file2_ file2
470467
'
471468

472469
test_expect_success 'shutdown' '

0 commit comments

Comments
 (0)