Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/go-gitea/gitea into refacto…
Browse files Browse the repository at this point in the history
…r-user-service
  • Loading branch information
KN4CK3R committed Jan 9, 2024
2 parents 386fc5a + aa4d784 commit 89f71f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/fixtures/user.yml
Expand Up @@ -1368,4 +1368,4 @@
visibility: 0
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
keep_activity_private: false
4 changes: 3 additions & 1 deletion routers/api/v1/admin/user.go
Expand Up @@ -453,6 +453,8 @@ func RenameUser(ctx *context.APIContext) {
// schema:
// "$ref": "#/definitions/RenameUserOption"
// responses:
// "204":
// "$ref": "#/responses/empty"
// "403":
// "$ref": "#/responses/forbidden"
// "422":
Expand Down Expand Up @@ -484,5 +486,5 @@ func RenameUser(ctx *context.APIContext) {
}

log.Trace("User name changed: %s -> %s", oldName, newName)
ctx.Status(http.StatusOK)
ctx.Status(http.StatusNoContent)
}
4 changes: 4 additions & 0 deletions services/pull/pull.go
Expand Up @@ -4,6 +4,7 @@
package pull

import (
"bytes"
"context"
"fmt"
"io"
Expand Down Expand Up @@ -422,9 +423,11 @@ func checkIfPRContentChanged(ctx context.Context, pr *issues_model.PullRequest,
return false, fmt.Errorf("unable to open pipe for to run diff: %w", err)
}

stderr := new(bytes.Buffer)
if err := cmd.Run(&git.RunOpts{
Dir: prCtx.tmpBasePath,
Stdout: stdoutWriter,
Stderr: stderr,
PipelineFunc: func(ctx context.Context, cancel context.CancelFunc) error {
_ = stdoutWriter.Close()
defer func() {
Expand All @@ -436,6 +439,7 @@ func checkIfPRContentChanged(ctx context.Context, pr *issues_model.PullRequest,
if err == util.ErrNotEmpty {
return true, nil
}
err = git.ConcatenateError(err, stderr.String())

log.Error("Unable to run diff on %s %s %s in tempRepo for PR[%d]%s/%s...%s/%s: Error: %v",
newCommitID, oldCommitID, base,
Expand Down

0 comments on commit 89f71f6

Please sign in to comment.