3 test_description
='Clone repositories and map users'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'start p4d' '
12 test_expect_success
'Create a repo with different users' '
13 client_view "//depot/... //client/..." &&
19 p4 submit -d "Add file author\\n" &&
24 p4 submit -d "Add file max" &&
29 p4 submit -d "Add file moritz" &&
34 p4 submit -d "Add file nobody"
38 test_expect_success
'Clone repo root path with all history' '
39 client_view "//depot/... //client/..." &&
40 test_when_finished cleanup_git &&
44 git config --add git-p4.mapUser "mmax = Max Musterman <max@example.com> " &&
45 git config --add git-p4.mapUser " eri=Erika Musterman <erika@example.com>" &&
46 git p4 clone --use-client-spec --destination="$git" //depot@all &&
47 cat >expect <<-\EOF &&
49 Erika Musterman <erika@example.com>
50 Max Musterman <max@example.com>
51 Dr. author <author@example.com>
53 git log --format="%an <%ae>" >actual &&
54 test_cmp expect actual