@@ -19,16 +19,6 @@ test_expect_success 'create files' '
19
19
)
20
20
'
21
21
22
- p4_add_user () {
23
- name=$1 fullname=$2 &&
24
- p4 user -f -i << -EOF &&
25
- User: $name
26
- Email: $name @localhost
27
- FullName: $fullname
28
- EOF
29
- p4 passwd -P secret $name
30
- }
31
-
32
22
p4_grant_admin () {
33
23
name=$1 &&
34
24
{
@@ -51,17 +41,17 @@ make_change_by_user() {
51
41
52
42
# Test username support, submitting as user 'alice'
53
43
test_expect_success ' preserve users' '
54
- p4_add_user alice Alice &&
55
- p4_add_user bob Bob &&
44
+ p4_add_user alice &&
45
+ p4_add_user bob &&
56
46
p4_grant_admin alice &&
57
47
git p4 clone --dest="$git" //depot &&
58
48
test_when_finished cleanup_git &&
59
49
(
60
50
cd "$git" &&
61
51
echo "username: a change by alice" >>file1 &&
62
52
echo "username: a change by bob" >>file2 &&
63
- git commit --author "Alice <alice@localhost >" -m "a change by alice" file1 &&
64
- git commit --author "Bob <bob@localhost >" -m "a change by bob" file2 &&
53
+ git commit --author "Alice <alice@example.com >" -m "a change by alice" file1 &&
54
+ git commit --author "Bob <bob@example.com >" -m "a change by bob" file2 &&
65
55
git config git-p4.skipSubmitEditCheck true &&
66
56
P4EDITOR=touch P4USER=alice P4PASSWD=secret git p4 commit --preserve-user &&
67
57
p4_check_commit_author file1 alice &&
@@ -78,7 +68,7 @@ test_expect_success 'refuse to preserve users without perms' '
78
68
cd "$git" &&
79
69
git config git-p4.skipSubmitEditCheck true &&
80
70
echo "username-noperms: a change by alice" >>file1 &&
81
- git commit --author "Alice <alice@localhost >" -m "perms: a change by alice" file1 &&
71
+ git commit --author "Alice <alice@example.com >" -m "perms: a change by alice" file1 &&
82
72
P4EDITOR=touch P4USER=bob P4PASSWD=secret &&
83
73
export P4EDITOR P4USER P4PASSWD &&
84
74
test_must_fail git p4 commit --preserve-user &&
@@ -94,9 +84,9 @@ test_expect_success 'preserve user where author is unknown to p4' '
94
84
cd "$git" &&
95
85
git config git-p4.skipSubmitEditCheck true &&
96
86
echo "username-bob: a change by bob" >>file1 &&
97
- git commit --author "Bob <bob@localhost >" -m "preserve: a change by bob" file1 &&
87
+ git commit --author "Bob <bob@example.com >" -m "preserve: a change by bob" file1 &&
98
88
echo "username-unknown: a change by charlie" >>file1 &&
99
- git commit --author "Charlie <charlie@localhost >" -m "preserve: a change by charlie" file1 &&
89
+ git commit --author "Charlie <charlie@example.com >" -m "preserve: a change by charlie" file1 &&
100
90
P4EDITOR=touch P4USER=alice P4PASSWD=secret &&
101
91
export P4EDITOR P4USER P4PASSWD &&
102
92
test_must_fail git p4 commit --preserve-user &&
@@ -121,24 +111,24 @@ test_expect_success 'not preserving user with mixed authorship' '
121
111
(
122
112
cd "$git" &&
123
113
git config git-p4.skipSubmitEditCheck true &&
124
- p4_add_user derek Derek &&
114
+ p4_add_user derek &&
125
115
126
- make_change_by_user usernamefile3 Derek derek@localhost &&
116
+ make_change_by_user usernamefile3 Derek derek@example.com &&
127
117
P4EDITOR=cat P4USER=alice P4PASSWD=secret &&
128
118
export P4EDITOR P4USER P4PASSWD &&
129
119
git p4 commit |\
130
- grep "git author derek@localhost does not match" &&
120
+ grep "git author derek@example.com does not match" &&
131
121
132
- make_change_by_user usernamefile3 Charlie charlie@localhost &&
122
+ make_change_by_user usernamefile3 Charlie charlie@example.com &&
133
123
git p4 commit |\
134
- grep "git author charlie@localhost does not match" &&
124
+ grep "git author charlie@example.com does not match" &&
135
125
136
- make_change_by_user usernamefile3 alice alice@localhost &&
126
+ make_change_by_user usernamefile3 alice alice@example.com &&
137
127
git p4 commit |\
138
128
test_must_fail grep "git author.*does not match" &&
139
129
140
130
git config git-p4.skipUserNameCheck true &&
141
- make_change_by_user usernamefile3 Charlie charlie@localhost &&
131
+ make_change_by_user usernamefile3 Charlie charlie@example.com &&
142
132
git p4 commit |\
143
133
test_must_fail grep "git author.*does not match" &&
144
134
0 commit comments