Skip to content

Commit 19618ec

Browse files
committed
fix(api/repo/contents): set the dates to now when not specified by the caller
1 parent a0f492d commit 19618ec

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)