Skip to content

Commit 61e5cc1

Browse files
divyunGiteaBot
andauthored
fix(api/repo/contents): set the dates to now when not specified by the caller (#35861)
Since 1.25.0, the dates get set to `2001-01-01T00:00:00Z`, when not specified by the caller. Fixes #35860 Co-authored-by: Giteabot <teabot@gitea.io>
1 parent 84d7496 commit 61e5cc1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routers/api/v1/repo/file.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,11 @@ func ReqChangeRepoFileOptionsAndCheck(ctx *context.APIContext) {
370370
},
371371
Signoff: commonOpts.Signoff,
372372
}
373-
if commonOpts.Dates.Author.IsZero() {
374-
commonOpts.Dates.Author = time.Now()
373+
if changeFileOpts.Dates.Author.IsZero() {
374+
changeFileOpts.Dates.Author = time.Now()
375375
}
376-
if commonOpts.Dates.Committer.IsZero() {
377-
commonOpts.Dates.Committer = time.Now()
376+
if changeFileOpts.Dates.Committer.IsZero() {
377+
changeFileOpts.Dates.Committer = time.Now()
378378
}
379379
ctx.Data["__APIChangeRepoFilesOptions"] = changeFileOpts
380380
}

0 commit comments

Comments
 (0)