Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  Add download attribute to release attachments (go-gitea#28739)
  Concatenate error in `checkIfPRContentChanged` (go-gitea#28731)
  • Loading branch information
zjjhot committed Jan 10, 2024
2 parents 26df9d8 + a80debc commit 518fcf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions services/pull/pull.go
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion templates/repo/release/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
{{if .Attachments}}
{{range .Attachments}}
<li>
<a target="_blank" rel="nofollow" href="{{.DownloadURL}}">
<a target="_blank" rel="nofollow" href="{{.DownloadURL}}" download>
<strong>{{svg "octicon-package" 16 "gt-mr-2"}}{{.Name}}</strong>
</a>
<div>
Expand Down

0 comments on commit 518fcf9

Please sign in to comment.