Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ XGO_VERSION := go-1.25.x
AIR_PACKAGE ?= github.com/air-verse/air@v1
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.9.2
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.9.0
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.15
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.7.0
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.33.1
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module code.gitea.io/gitea

go 1.25.0

toolchain go1.25.7
go 1.26.0
Copy link
Copy Markdown
Member Author

@silverwind silverwind Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently go mod tidy gets rid of the toolchain directive when it matches the minimum go version because go considers it "redundant". We have to keep in mind to restore the directive for 1.26.1 so that govulncheck can target it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golang issue about this: golang/go#75331


// rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
// But some CAs use negative serial number, just relax the check. related:
Expand Down
5 changes: 2 additions & 3 deletions models/asymkey/gpg_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"

"github.com/ProtonMail/go-crypto/openpgp"
"github.com/ProtonMail/go-crypto/openpgp/packet"
Expand Down Expand Up @@ -398,7 +397,7 @@ epiDVQ==
func TestTryGetKeyIDFromSignature(t *testing.T) {
assert.Empty(t, TryGetKeyIDFromSignature(&packet.Signature{}))
assert.Equal(t, "038D1A3EADDBEA9C", TryGetKeyIDFromSignature(&packet.Signature{
IssuerKeyId: util.ToPointer(uint64(0x38D1A3EADDBEA9C)),
IssuerKeyId: new(uint64(0x38D1A3EADDBEA9C)),
}))
assert.Equal(t, "038D1A3EADDBEA9C", TryGetKeyIDFromSignature(&packet.Signature{
IssuerFingerprint: []uint8{0xb, 0x23, 0x24, 0xc7, 0xe6, 0xfe, 0x4f, 0x3a, 0x6, 0x26, 0xc1, 0x21, 0x3, 0x8d, 0x1a, 0x3e, 0xad, 0xdb, 0xea, 0x9c},
Expand All @@ -419,7 +418,7 @@ func TestParseGPGKey(t *testing.T) {

// then revoke the key
for _, id := range e.Identities {
id.Revocations = append(id.Revocations, &packet.Signature{RevocationReason: util.ToPointer(packet.KeyCompromised)})
id.Revocations = append(id.Revocations, &packet.Signature{RevocationReason: new(packet.KeyCompromised)})
}
k, err = parseGPGKey(t.Context(), 1, e, true)
require.NoError(t, err)
Expand Down
5 changes: 0 additions & 5 deletions modules/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ func ToFloat64(number any) (float64, error) {
return value, nil
}

// ToPointer returns the pointer of a copy of any given value
func ToPointer[T any](val T) *T {
return &val
}

// Iif is an "inline-if", it returns "trueVal" if "condition" is true, otherwise "falseVal"
func Iif[T any](condition bool, trueVal, falseVal T) T {
if condition {
Expand Down
9 changes: 0 additions & 9 deletions modules/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,6 @@ func TestToTitleCase(t *testing.T) {
assert.Equal(t, `Foo Bar Baz`, ToTitleCase(`FOO BAR BAZ`))
}

func TestToPointer(t *testing.T) {
assert.Equal(t, "abc", *ToPointer("abc"))
assert.Equal(t, 123, *ToPointer(123))
abc := "abc"
assert.NotSame(t, &abc, ToPointer(abc))
val123 := 123
assert.NotSame(t, &val123, ToPointer(val123))
}

func TestReserveLineBreakForTextarea(t *testing.T) {
assert.Equal(t, "test\ndata", ReserveLineBreakForTextarea("test\r\ndata"))
assert.Equal(t, "test\ndata\n", ReserveLineBreakForTextarea("test\r\ndata\r\n"))
Expand Down
8 changes: 4 additions & 4 deletions modules/web/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestRouter(t *testing.T) {
chiCtx := chi.RouteContext(req.Context())
res.method = req.Method
res.pathParams = chiURLParamsToMap(chiCtx)
res.chiRoutePattern = util.ToPointer(chiCtx.RoutePattern())
res.chiRoutePattern = new(chiCtx.RoutePattern())
if mark != "" {
res.handlerMarks = append(res.handlerMarks, mark)
}
Expand Down Expand Up @@ -139,7 +139,7 @@ func TestRouter(t *testing.T) {
testRoute(t, "GET /the-user/the-repo/other", resultStruct{
method: "GET",
handlerMarks: []string{"not-found:/"},
chiRoutePattern: util.ToPointer(""),
chiRoutePattern: new(""),
})
testRoute(t, "GET /the-user/the-repo/pulls", resultStruct{
method: "GET",
Expand All @@ -150,7 +150,7 @@ func TestRouter(t *testing.T) {
method: "GET",
pathParams: map[string]string{"username": "the-user", "reponame": "the-repo", "type": "issues", "index": "123"},
handlerMarks: []string{"view-issue"},
chiRoutePattern: util.ToPointer("/{username}/{reponame}/{type:issues|pulls}/{index}"),
chiRoutePattern: new("/{username}/{reponame}/{type:issues|pulls}/{index}"),
})
testRoute(t, "GET /the-user/the-repo/issues/123?stop=hijack", resultStruct{
method: "GET",
Expand Down Expand Up @@ -228,7 +228,7 @@ func TestRouter(t *testing.T) {
method: "GET",
pathParams: map[string]string{"username": "the-user", "reponame": "the-repo", "*": "d1/d2/fn", "dir": "d1/d2", "file": "fn"},
handlerMarks: []string{"s1", "s2", "s3"},
chiRoutePattern: util.ToPointer("/api/v1/repos/{username}/{reponame}/branches/<dir:*>/<file:[a-z]{1,2}>"),
chiRoutePattern: new("/api/v1/repos/{username}/{reponame}/branches/<dir:*>/<file:[a-z]{1,2}>"),
})
})
}
Expand Down
3 changes: 1 addition & 2 deletions routers/web/repo/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/routers/common"
"code.gitea.io/gitea/services/attachment"
"code.gitea.io/gitea/services/context"
Expand Down Expand Up @@ -200,7 +199,7 @@ func ServeAttachment(ctx *context.Context, uuid string) {
}
defer fr.Close()

common.ServeContentByReadSeeker(ctx.Base, attach.Name, util.ToPointer(attach.CreatedUnix.AsTime()), fr)
common.ServeContentByReadSeeker(ctx.Base, attach.Name, new(attach.CreatedUnix.AsTime()), fr)
}

// GetAttachment serve attachments
Expand Down
6 changes: 3 additions & 3 deletions services/migrations/codebase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ func TestCodebaseDownloadRepo(t *testing.T) {
assertMilestonesEqual(t, []*base.Milestone{
{
Title: "Milestone1",
Deadline: timePtr(time.Date(2021, time.September, 16, 0, 0, 0, 0, time.UTC)),
Deadline: new(time.Date(2021, time.September, 16, 0, 0, 0, 0, time.UTC)),
},
{
Title: "Milestone2",
Deadline: timePtr(time.Date(2021, time.September, 17, 0, 0, 0, 0, time.UTC)),
Closed: timePtr(time.Date(2021, time.September, 17, 0, 0, 0, 0, time.UTC)),
Deadline: new(time.Date(2021, time.September, 17, 0, 0, 0, 0, time.UTC)),
Closed: new(time.Date(2021, time.September, 17, 0, 0, 0, 0, time.UTC)),
State: "closed",
},
}, milestones)
Expand Down
9 changes: 4 additions & 5 deletions services/migrations/codecommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"code.gitea.io/gitea/modules/log"
base "code.gitea.io/gitea/modules/migration"
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"

"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/codecommit"
Expand Down Expand Up @@ -87,7 +86,7 @@ type CodeCommitDownloader struct {
// GetRepoInfo returns a repository information
func (c *CodeCommitDownloader) GetRepoInfo(ctx context.Context) (*base.Repository, error) {
output, err := c.codeCommitClient.GetRepository(ctx, &codecommit.GetRepositoryInput{
RepositoryName: util.ToPointer(c.repoName),
RepositoryName: new(c.repoName),
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -119,7 +118,7 @@ func (c *CodeCommitDownloader) GetComments(ctx context.Context, commentable base
for {
resp, err := c.codeCommitClient.GetCommentsForPullRequest(ctx, &codecommit.GetCommentsForPullRequestInput{
NextToken: nextToken,
PullRequestId: util.ToPointer(strconv.FormatInt(commentable.GetForeignIndex(), 10)),
PullRequestId: new(strconv.FormatInt(commentable.GetForeignIndex(), 10)),
})
if err != nil {
return nil, false, err
Expand Down Expand Up @@ -161,7 +160,7 @@ func (c *CodeCommitDownloader) GetPullRequests(ctx context.Context, page, perPag
prs := make([]*base.PullRequest, 0, len(batch))
for _, id := range batch {
output, err := c.codeCommitClient.GetPullRequest(ctx, &codecommit.GetPullRequestInput{
PullRequestId: util.ToPointer(id),
PullRequestId: new(id),
})
if err != nil {
return nil, false, err
Expand Down Expand Up @@ -241,7 +240,7 @@ func (c *CodeCommitDownloader) getAllPullRequestIDs(ctx context.Context) ([]stri

for {
output, err := c.codeCommitClient.ListPullRequests(ctx, &codecommit.ListPullRequestsInput{
RepositoryName: util.ToPointer(c.repoName),
RepositoryName: new(c.repoName),
NextToken: nextToken,
})
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions services/migrations/gitea_downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ func TestGiteaDownloadRepo(t *testing.T) {
{
Title: "V2 Finalize",
Created: time.Unix(0, 0),
Deadline: timePtr(time.Unix(1599263999, 0)),
Updated: timePtr(time.Unix(0, 0)),
Deadline: new(time.Unix(1599263999, 0)),
Updated: new(time.Unix(0, 0)),
State: "open",
},
{
Title: "V1",
Description: "Generate Content",
Created: time.Unix(0, 0),
Updated: timePtr(time.Unix(0, 0)),
Closed: timePtr(time.Unix(1598985406, 0)),
Updated: new(time.Unix(0, 0)),
Closed: new(time.Unix(1598985406, 0)),
State: "closed",
},
}, milestones)
Expand Down Expand Up @@ -171,7 +171,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
Content: "laugh",
},
},
Closed: timePtr(time.Date(2020, 9, 1, 15, 49, 34, 0, time.UTC)),
Closed: new(time.Date(2020, 9, 1, 15, 49, 34, 0, time.UTC)),
},
{
Number: 2,
Expand All @@ -190,7 +190,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
Color: "d4c5f9",
Description: "",
}},
Closed: timePtr(time.Unix(1598969497, 0)),
Closed: new(time.Unix(1598969497, 0)),
},
}, issues)

Expand Down Expand Up @@ -237,7 +237,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
IsLocked: false,
Created: time.Unix(1598982759, 0),
Updated: time.Unix(1599023425, 0),
Closed: timePtr(time.Unix(1598982934, 0)),
Closed: new(time.Unix(1598982934, 0)),
Assignees: []string{"techknowlogick"},
Base: base.PullRequestBranch{
CloneURL: "",
Expand All @@ -254,7 +254,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
OwnerName: "6543-forks",
},
Merged: true,
MergedTime: timePtr(time.Unix(1598982934, 0)),
MergedTime: new(time.Unix(1598982934, 0)),
MergeCommitSHA: "827aa28a907853e5ddfa40c8f9bc52471a2685fd",
PatchURL: "https://gitea.com/gitea/test_repo/pulls/12.patch",
}, prs[1])
Expand Down
20 changes: 10 additions & 10 deletions services/migrations/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ func TestGitHubDownloadRepo(t *testing.T) {
{
Title: "1.0.0",
Description: "Milestone 1.0.0",
Deadline: timePtr(time.Date(2019, 11, 11, 8, 0, 0, 0, time.UTC)),
Deadline: new(time.Date(2019, 11, 11, 8, 0, 0, 0, time.UTC)),
Created: time.Date(2019, 11, 12, 19, 37, 8, 0, time.UTC),
Updated: timePtr(time.Date(2019, 11, 12, 21, 56, 17, 0, time.UTC)),
Closed: timePtr(time.Date(2019, 11, 12, 19, 45, 49, 0, time.UTC)),
Updated: new(time.Date(2019, 11, 12, 21, 56, 17, 0, time.UTC)),
Closed: new(time.Date(2019, 11, 12, 19, 45, 49, 0, time.UTC)),
State: "closed",
},
{
Title: "1.1.0",
Description: "Milestone 1.1.0",
Deadline: timePtr(time.Date(2019, 11, 12, 8, 0, 0, 0, time.UTC)),
Deadline: new(time.Date(2019, 11, 12, 8, 0, 0, 0, time.UTC)),
Created: time.Date(2019, 11, 12, 19, 37, 25, 0, time.UTC),
Updated: timePtr(time.Date(2019, 11, 12, 21, 39, 27, 0, time.UTC)),
Closed: timePtr(time.Date(2019, 11, 12, 19, 45, 46, 0, time.UTC)),
Updated: new(time.Date(2019, 11, 12, 21, 39, 27, 0, time.UTC)),
Closed: new(time.Date(2019, 11, 12, 19, 45, 46, 0, time.UTC)),
State: "closed",
},
}, milestones)
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestGitHubDownloadRepo(t *testing.T) {
Content: "+1",
},
},
Closed: timePtr(time.Date(2019, 11, 12, 20, 22, 22, 0, time.UTC)),
Closed: new(time.Date(2019, 11, 12, 20, 22, 22, 0, time.UTC)),
},
{
Number: 2,
Expand Down Expand Up @@ -214,7 +214,7 @@ func TestGitHubDownloadRepo(t *testing.T) {
Content: "+1",
},
},
Closed: timePtr(time.Date(2019, 11, 12, 21, 1, 31, 0, time.UTC)),
Closed: new(time.Date(2019, 11, 12, 21, 1, 31, 0, time.UTC)),
},
}, issues)

Expand Down Expand Up @@ -284,9 +284,9 @@ func TestGitHubDownloadRepo(t *testing.T) {
OwnerName: "go-gitea",
RepoName: "test_repo",
},
Closed: timePtr(time.Date(2019, 11, 12, 21, 39, 27, 0, time.UTC)),
Closed: new(time.Date(2019, 11, 12, 21, 39, 27, 0, time.UTC)),
Merged: true,
MergedTime: timePtr(time.Date(2019, 11, 12, 21, 39, 27, 0, time.UTC)),
MergedTime: new(time.Date(2019, 11, 12, 21, 39, 27, 0, time.UTC)),
MergeCommitSHA: "f32b0a9dfd09a60f616f29158f772cedd89942d2",
ForeignIndex: 3,
},
Expand Down
10 changes: 5 additions & 5 deletions services/migrations/gitlab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ func TestGitlabDownloadRepo(t *testing.T) {
{
Title: "1.1.0",
Created: time.Date(2019, 11, 28, 8, 42, 44, 575000000, time.UTC),
Updated: timePtr(time.Date(2019, 11, 28, 8, 42, 44, 575000000, time.UTC)),
Updated: new(time.Date(2019, 11, 28, 8, 42, 44, 575000000, time.UTC)),
State: "active",
},
{
Title: "1.0.0",
Created: time.Date(2019, 11, 28, 8, 42, 30, 301000000, time.UTC),
Updated: timePtr(time.Date(2019, 11, 28, 15, 57, 52, 401000000, time.UTC)),
Closed: timePtr(time.Date(2019, 11, 28, 15, 57, 52, 401000000, time.UTC)),
Updated: new(time.Date(2019, 11, 28, 15, 57, 52, 401000000, time.UTC)),
Closed: new(time.Date(2019, 11, 28, 15, 57, 52, 401000000, time.UTC)),
State: "closed",
},
}, milestones)
Expand Down Expand Up @@ -161,7 +161,7 @@ func TestGitlabDownloadRepo(t *testing.T) {
Content: "open_mouth",
},
},
Closed: timePtr(time.Date(2019, 11, 28, 8, 46, 23, 275000000, time.UTC)),
Closed: new(time.Date(2019, 11, 28, 8, 46, 23, 275000000, time.UTC)),
},
{
Number: 2,
Expand Down Expand Up @@ -210,7 +210,7 @@ func TestGitlabDownloadRepo(t *testing.T) {
Content: "hearts",
},
},
Closed: timePtr(time.Date(2019, 11, 28, 8, 45, 44, 959000000, time.UTC)),
Closed: new(time.Date(2019, 11, 28, 8, 45, 44, 959000000, time.UTC)),
},
}, issues)

Expand Down
4 changes: 0 additions & 4 deletions services/migrations/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ func TestMain(m *testing.M) {
unittest.MainTest(m)
}

func timePtr(t time.Time) *time.Time {
return &t
}

func assertTimeEqual(t *testing.T, expected, actual time.Time) {
assert.Equal(t, expected.UTC(), actual.UTC())
}
Expand Down
10 changes: 5 additions & 5 deletions services/repository/files/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,18 @@ func getFileContentsByEntryInternal(ctx context.Context, repo *repo_model.Reposi
}

if opts.IncludeCommitMetadata {
contentsResponse.LastCommitSHA = util.ToPointer(lastCommit.ID.String())
contentsResponse.LastCommitSHA = new(lastCommit.ID.String())
// GitHub doesn't have these fields in the response, but we could follow other similar APIs to name them
// https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits
if lastCommit.Committer != nil {
contentsResponse.LastCommitterDate = util.ToPointer(lastCommit.Committer.When)
contentsResponse.LastCommitterDate = new(lastCommit.Committer.When)
}
if lastCommit.Author != nil {
contentsResponse.LastAuthorDate = util.ToPointer(lastCommit.Author.When)
contentsResponse.LastAuthorDate = new(lastCommit.Author.When)
}
}
if opts.IncludeCommitMessage {
contentsResponse.LastCommitMessage = util.ToPointer(lastCommit.Message())
contentsResponse.LastCommitMessage = new(lastCommit.Message())
}
}

Expand Down Expand Up @@ -281,7 +281,7 @@ func GetBlobBySHA(repo *repo_model.Repository, gitRepo *git.Repository, sha stri
return nil, err
}

ret.Encoding, ret.Content = util.ToPointer("base64"), &content
ret.Encoding, ret.Content = new("base64"), &content
if originContent != nil {
ret.LfsOid, ret.LfsSize = parsePossibleLfsPointerBuffer(strings.NewReader(originContent.String()))
}
Expand Down
4 changes: 2 additions & 2 deletions services/repository/files/content_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

"code.gitea.io/gitea/models/unittest"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"

Check failure on line 11 in services/repository/files/content_test.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

"code.gitea.io/gitea/modules/util" imported and not used (typecheck)

Check failure on line 11 in services/repository/files/content_test.go

View workflow job for this annotation

GitHub Actions / lint-backend

"code.gitea.io/gitea/modules/util" imported and not used (typecheck)

Check failure on line 11 in services/repository/files/content_test.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

"code.gitea.io/gitea/modules/util" imported and not used (typecheck)

Check failure on line 11 in services/repository/files/content_test.go

View workflow job for this annotation

GitHub Actions / test-unit

"code.gitea.io/gitea/modules/util" imported and not used
"code.gitea.io/gitea/services/contexttest"

_ "code.gitea.io/gitea/models/actions"
Expand Down Expand Up @@ -37,8 +37,8 @@
ctx.SetPathParam("sha", sha)
gbr, err := GetBlobBySHA(ctx.Repo.Repository, ctx.Repo.GitRepo, ctx.PathParam("sha"))
expectedGBR := &api.GitBlobResponse{
Content: util.ToPointer("dHJlZSAyYTJmMWQ0NjcwNzI4YTJlMTAwNDllMzQ1YmQ3YTI3NjQ2OGJlYWI2CmF1dGhvciB1c2VyMSA8YWRkcmVzczFAZXhhbXBsZS5jb20+IDE0ODk5NTY0NzkgLTA0MDAKY29tbWl0dGVyIEV0aGFuIEtvZW5pZyA8ZXRoYW50a29lbmlnQGdtYWlsLmNvbT4gMTQ4OTk1NjQ3OSAtMDQwMAoKSW5pdGlhbCBjb21taXQK"),
Encoding: util.ToPointer("base64"),
Content: new("dHJlZSAyYTJmMWQ0NjcwNzI4YTJlMTAwNDllMzQ1YmQ3YTI3NjQ2OGJlYWI2CmF1dGhvciB1c2VyMSA8YWRkcmVzczFAZXhhbXBsZS5jb20+IDE0ODk5NTY0NzkgLTA0MDAKY29tbWl0dGVyIEV0aGFuIEtvZW5pZyA8ZXRoYW50a29lbmlnQGdtYWlsLmNvbT4gMTQ4OTk1NjQ3OSAtMDQwMAoKSW5pdGlhbCBjb21taXQK"),
Encoding: new("base64"),
URL: "https://try.gitea.io/api/v1/repos/user2/repo1/git/blobs/65f1bf27bc3bf70f64657658635e66094edbcb4d",
SHA: "65f1bf27bc3bf70f64657658635e66094edbcb4d",
Size: 180,
Expand Down
2 changes: 1 addition & 1 deletion services/repository/files/temp_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (t *TemporaryUploadRepository) CommitTree(ctx context.Context, opts *Commit
authorDate := opts.AuthorTime
committerDate := opts.CommitterTime
if authorDate == nil && committerDate == nil {
authorDate = util.ToPointer(time.Now())
authorDate = new(time.Now())
committerDate = authorDate
} else if authorDate == nil {
authorDate = committerDate
Expand Down
Loading
Loading