git-p4: add test for p4 labels
[git/mingw.git] / t / t9804-git-p4-label.sh
blob5fa2bcfa97c738351509ffdfe9202e25ecea7f2a
1 test_description='git-p4 p4 label tests'
3 . ./lib-git-p4.sh
5 test_expect_success 'start p4d' '
6 start_p4d
9 # Basic p4 label tests.
11 # Note: can't have more than one label per commit - others
12 # are silently discarded.
14 test_expect_success 'basic p4 labels' '
15 test_when_finished cleanup_git &&
17 cd "$cli" &&
18 mkdir -p main &&
20 echo f1 >main/f1 &&
21 p4 add main/f1 &&
22 p4 submit -d "main/f1" &&
24 echo f2 >main/f2 &&
25 p4 add main/f2 &&
26 p4 submit -d "main/f2" &&
28 echo f3 >main/file_with_\$metachar &&
29 p4 add main/file_with_\$metachar &&
30 p4 submit -d "file with metachar" &&
32 p4 tag -l tag_f1_only main/f1 &&
33 p4 tag -l tag_with\$_shell_char main/... &&
35 echo f4 >main/f4 &&
36 p4 add main/f4 &&
37 p4 submit -d "main/f4" &&
39 p4 label -i <<-EOF &&
40 Label: long_label
41 Description:
42 A Label first line
43 A Label second line
44 View: //depot/...
45 EOF
47 p4 tag -l long_label ... &&
49 p4 labels ... &&
51 "$GITP4" clone --dest="$git" --detect-labels //depot@all &&
52 cd "$git" &&
54 git tag &&
55 git tag >taglist &&
56 test_line_count = 3 taglist &&
58 cd main &&
59 git checkout tag_tag_f1_only &&
60 ! test -f f2 &&
61 git checkout tag_tag_with\$_shell_char &&
62 test -f f1 && test -f f2 && test -f file_with_\$metachar &&
64 git show tag_long_label | grep -q "A Label second line"
68 test_expect_success 'kill p4d' '
69 kill_p4d
72 test_done