Merge branch 'ml/t9811-replace-test-f'

The test script 't/t9811-git-p4-label-import.sh' has been
modernized to use 'test_path_is_file' and 'test_path_is_missing'
instead of raw 'test -f' and '! test -f' calls.

* ml/t9811-replace-test-f:
  t9811: replace 'test -f' and '! test -f' with 'test_path_*'
  t9811: break long && chains into multiple lines
main
Junio C Hamano 2026-07-22 10:30:53 -07:00
commit 0a4f81e303
1 changed files with 22 additions and 12 deletions

View File

@ -62,9 +62,11 @@ test_expect_success 'basic p4 labels' '

cd main &&
git checkout TAG_F1_ONLY &&
! test -f f2 &&
test_path_is_missing f2 &&
git checkout TAG_WITH\$_SHELL_CHAR &&
test -f f1 && test -f f2 && test -f file_with_\$metachar &&
test_path_is_file f1 &&
test_path_is_file f2 &&
test_path_is_file file_with_\$metachar &&

git show TAG_LONG_LABEL | grep -q "A Label second line"
)
@ -102,11 +104,11 @@ test_expect_success 'two labels on the same changelist' '

git checkout TAG_F1_1 &&
ls &&
test -f f1 &&
test_path_is_file f1 &&

git checkout TAG_F1_2 &&
ls &&
test -f f1
test_path_is_file f1
)
'

@ -135,9 +137,9 @@ test_expect_success 'export git tags to p4' '
p4 labels ... | grep LIGHTWEIGHT_TAG &&
p4 label -o GIT_TAG_1 | grep "tag created in git:xyzzy" &&
p4 sync ...@GIT_TAG_1 &&
! test -f main/f10 &&
test_path_is_missing main/f10 &&
p4 sync ...@GIT_TAG_2 &&
test -f main/f10
test_path_is_file main/f10
)
'

@ -168,9 +170,9 @@ test_expect_success 'export git tags to p4 with deletion' '
cd "$cli" &&
p4 sync ... &&
p4 sync ...@GIT_TAG_ON_DELETED &&
test -f main/deleted_file &&
test_path_is_file main/deleted_file &&
p4 sync ...@GIT_TAG_AFTER_DELETION &&
! test -f main/deleted_file &&
test_path_is_missing main/deleted_file &&
echo "checking label contents" &&
p4 label -o GIT_TAG_ON_DELETED | grep "tag on deleted file"
)
@ -231,17 +233,25 @@ test_expect_success 'importing labels with missing revisions' '
P4CLIENT=missing-revision &&
client_view "//depot/missing-revision/... //missing-revision/..." &&
cd "$cli" &&
>f1 && p4 add f1 && p4 submit -d "start" &&
>f1 &&
p4 add f1 &&
p4 submit -d "start" &&

p4 tag -l TAG_S0 ... &&

>f2 && p4 add f2 && p4 submit -d "second" &&
>f2 &&
p4 add f2 &&
p4 submit -d "second" &&

startrev=$(p4_head_revision //depot/missing-revision/...) &&

>f3 && p4 add f3 && p4 submit -d "third" &&
>f3 &&
p4 add f3 &&
p4 submit -d "third" &&

p4 edit f2 && date >f2 && p4 submit -d "change" f2 &&
p4 edit f2 &&
date >f2 &&
p4 submit -d "change" f2 &&

endrev=$(p4_head_revision //depot/missing-revision/...) &&