Merge branch 'nd/worktree-list-fixup'
[alt-git.git] / t / t9828-git-p4-map-user.sh
blobe20395c89f3dbc461516e22339f9fef47bd3426e
1 #!/bin/sh
3 test_description='Clone repositories and map users'
5 . ./lib-git-p4.sh
7 test_expect_success 'start p4d' '
8 start_p4d
11 test_expect_success 'Create a repo with different users' '
12 client_view "//depot/... //client/..." &&
14 cd "$cli" &&
16 >author.txt &&
17 p4 add author.txt &&
18 p4 submit -d "Add file author\\n" &&
20 P4USER=mmax &&
21 >max.txt &&
22 p4 add max.txt &&
23 p4 submit -d "Add file max" &&
25 P4USER=eri &&
26 >moritz.txt &&
27 p4 add moritz.txt &&
28 p4 submit -d "Add file moritz" &&
30 P4USER=no &&
31 >nobody.txt &&
32 p4 add nobody.txt &&
33 p4 submit -d "Add file nobody"
37 test_expect_success 'Clone repo root path with all history' '
38 client_view "//depot/... //client/..." &&
39 test_when_finished cleanup_git &&
41 cd "$git" &&
42 git init . &&
43 git config --add git-p4.mapUser "mmax = Max Musterman <max@example.com> " &&
44 git config --add git-p4.mapUser " eri=Erika Musterman <erika@example.com>" &&
45 git p4 clone --use-client-spec --destination="$git" //depot@all &&
46 cat >expect <<-\EOF &&
47 no <no@client>
48 Erika Musterman <erika@example.com>
49 Max Musterman <max@example.com>
50 Dr. author <author@example.com>
51 EOF
52 git log --format="%an <%ae>" >actual &&
53 test_cmp expect actual
57 test_expect_success 'kill p4d' '
58 kill_p4d
61 test_done