mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-10 03:57:59 -05:00
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>
This commit is contained in:
@@ -370,11 +370,11 @@ func ReqChangeRepoFileOptionsAndCheck(ctx *context.APIContext) {
|
|||||||
},
|
},
|
||||||
Signoff: commonOpts.Signoff,
|
Signoff: commonOpts.Signoff,
|
||||||
}
|
}
|
||||||
if commonOpts.Dates.Author.IsZero() {
|
if changeFileOpts.Dates.Author.IsZero() {
|
||||||
commonOpts.Dates.Author = time.Now()
|
changeFileOpts.Dates.Author = time.Now()
|
||||||
}
|
}
|
||||||
if commonOpts.Dates.Committer.IsZero() {
|
if changeFileOpts.Dates.Committer.IsZero() {
|
||||||
commonOpts.Dates.Committer = time.Now()
|
changeFileOpts.Dates.Committer = time.Now()
|
||||||
}
|
}
|
||||||
ctx.Data["__APIChangeRepoFilesOptions"] = changeFileOpts
|
ctx.Data["__APIChangeRepoFilesOptions"] = changeFileOpts
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user