Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Clutch
Commits
3edf2da0
Commit
3edf2da0
authored
3 years ago
by
Jun Gan
Browse files
Options
Download
Email Patches
Plain Diff
fix UT and remove extra logging
parent
b20e384d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/service/github/github.go
+0
-1
backend/service/github/github.go
backend/service/github/github_test.go
+3
-3
backend/service/github/github_test.go
with
3 additions
and
4 deletions
+3
-4
backend/service/github/github.go
+
0
-
1
View file @
3edf2da0
...
...
@@ -358,7 +358,6 @@ func (s *svc) CreateBranch(ctx context.Context, req *CreateBranchRequest) error
}
opts
:=
commitOptionsFromClaims
(
ctx
)
s
.
logger
.
Info
(
fmt
.
Sprintf
(
"Commit author: %s"
,
opts
.
Author
.
String
()))
if
_
,
err
:=
wt
.
Commit
(
req
.
CommitMessage
,
opts
);
err
!=
nil
{
return
err
}
...
...
This diff is collapsed.
Click to expand it.
backend/service/github/github_test.go
+
3
-
3
View file @
3edf2da0
...
...
@@ -840,7 +840,7 @@ func TestCommitAuthorFromContext(t *testing.T) {
result
:=
commitOptionsFromClaims
(
ctx
)
assert
.
Equal
(
t
,
"Anonymous User via Clutch"
,
result
.
Author
.
Name
)
assert
.
Equal
(
t
,
"
<>
"
,
result
.
Author
.
Email
)
assert
.
Equal
(
t
,
""
,
result
.
Author
.
Email
)
ctx
=
authn
.
ContextWithClaims
(
ctx
,
&
authn
.
Claims
{
StandardClaims
:
&
jwt
.
StandardClaims
{
...
...
@@ -850,7 +850,7 @@ func TestCommitAuthorFromContext(t *testing.T) {
result
=
commitOptionsFromClaims
(
ctx
)
assert
.
Equal
(
t
,
"daniel@example.com via Clutch"
,
result
.
Author
.
Name
)
assert
.
Equal
(
t
,
"
<
daniel@example.com
>
"
,
result
.
Author
.
Email
)
assert
.
Equal
(
t
,
"daniel@example.com"
,
result
.
Author
.
Email
)
ctx
=
authn
.
ContextWithClaims
(
ctx
,
&
authn
.
Claims
{
StandardClaims
:
&
jwt
.
StandardClaims
{
...
...
@@ -860,5 +860,5 @@ func TestCommitAuthorFromContext(t *testing.T) {
result
=
commitOptionsFromClaims
(
ctx
)
assert
.
Equal
(
t
,
"daniel123 via Clutch"
,
result
.
Author
.
Name
)
assert
.
Equal
(
t
,
"
<>
"
,
result
.
Author
.
Email
)
assert
.
Equal
(
t
,
""
,
result
.
Author
.
Email
)
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment