Merge branch 'ks/branch-set-upstream'
[git/debian.git] / t / t9829-git-p4-jobs.sh
blob971aeeea1fb69ff5b73109d8b9496b5574317cd5
1 #!/bin/sh
3 test_description='git p4 retrieve job info'
5 . ./lib-git-p4.sh
7 test_expect_success 'start p4d' '
8 start_p4d
11 test_expect_success 'add p4 jobs' '
13 p4_add_job TESTJOB-A &&
14 p4_add_job TESTJOB-B
18 test_expect_success 'add p4 files' '
19 client_view "//depot/... //client/..." &&
21 cd "$cli" &&
22 >file1 &&
23 p4 add file1 &&
24 p4 submit -d "Add file 1"
28 test_expect_success 'check log message of changelist with no jobs' '
29 client_view "//depot/... //client/..." &&
30 test_when_finished cleanup_git &&
32 cd "$git" &&
33 git init . &&
34 git p4 clone --use-client-spec --destination="$git" //depot@all &&
35 cat >expect <<-\EOF &&
36 Add file 1
37 [git-p4: depot-paths = "//depot/": change = 1]
39 EOF
40 git log --format=%B >actual &&
41 test_cmp expect actual
45 test_expect_success 'add TESTJOB-A to change 1' '
47 cd "$cli" &&
48 p4 fix -c 1 TESTJOB-A
52 test_expect_success 'check log message of changelist with one job' '
53 client_view "//depot/... //client/..." &&
54 test_when_finished cleanup_git &&
56 cd "$git" &&
57 git init . &&
58 git p4 clone --use-client-spec --destination="$git" //depot@all &&
59 cat >expect <<-\EOF &&
60 Add file 1
61 Jobs: TESTJOB-A
62 [git-p4: depot-paths = "//depot/": change = 1]
64 EOF
65 git log --format=%B >actual &&
66 test_cmp expect actual
70 test_expect_success 'add TESTJOB-B to change 1' '
72 cd "$cli" &&
73 p4 fix -c 1 TESTJOB-B
77 test_expect_success 'check log message of changelist with more jobs' '
78 client_view "//depot/... //client/..." &&
79 test_when_finished cleanup_git &&
81 cd "$git" &&
82 git init . &&
83 git p4 clone --use-client-spec --destination="$git" //depot@all &&
84 cat >expect <<-\EOF &&
85 Add file 1
86 Jobs: TESTJOB-A TESTJOB-B
87 [git-p4: depot-paths = "//depot/": change = 1]
89 EOF
90 git log --format=%B >actual &&
91 test_cmp expect actual
95 test_expect_success 'kill p4d' '
96 kill_p4d
99 test_done