Skip to content

Commit 518fcf9

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Add download attribute to release attachments (go-gitea#28739) Concatenate error in `checkIfPRContentChanged` (go-gitea#28731)
2 parents 26df9d8 + a80debc commit 518fcf9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

services/pull/pull.go

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package pull
55

66
import (
7+
"bytes"
78
"context"
89
"fmt"
910
"io"
@@ -422,9 +423,11 @@ func checkIfPRContentChanged(ctx context.Context, pr *issues_model.PullRequest,
422423
return false, fmt.Errorf("unable to open pipe for to run diff: %w", err)
423424
}
424425

426+
stderr := new(bytes.Buffer)
425427
if err := cmd.Run(&git.RunOpts{
426428
Dir: prCtx.tmpBasePath,
427429
Stdout: stdoutWriter,
430+
Stderr: stderr,
428431
PipelineFunc: func(ctx context.Context, cancel context.CancelFunc) error {
429432
_ = stdoutWriter.Close()
430433
defer func() {
@@ -436,6 +439,7 @@ func checkIfPRContentChanged(ctx context.Context, pr *issues_model.PullRequest,
436439
if err == util.ErrNotEmpty {
437440
return true, nil
438441
}
442+
err = git.ConcatenateError(err, stderr.String())
439443

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

templates/repo/release/list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
{{if .Attachments}}
9595
{{range .Attachments}}
9696
<li>
97-
<a target="_blank" rel="nofollow" href="{{.DownloadURL}}">
97+
<a target="_blank" rel="nofollow" href="{{.DownloadURL}}" download>
9898
<strong>{{svg "octicon-package" 16 "gt-mr-2"}}{{.Name}}</strong>
9999
</a>
100100
<div>

0 commit comments

Comments
 (0)