Skip to content

Commit 49f4c4c

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

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

routers/api/v1/repo/file.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,14 @@ func ReqChangeRepoFileOptionsAndCheck(ctx *context.APIContext) {
370370
},
371371
Signoff: commonOpts.Signoff,
372372
}
373-
if commonOpts.Dates.Author.IsZero() {
374-
commonOpts.Dates.Author = time.Now()
373+
374+
if changeFileOpts.Dates.Author.IsZero() {
375+
changeFileOpts.Dates.Author = time.Now()
375376
}
376-
if commonOpts.Dates.Committer.IsZero() {
377-
commonOpts.Dates.Committer = time.Now()
377+
if changeFileOpts.Dates.Committer.IsZero() {
378+
changeFileOpts.Dates.Committer = time.Now()
378379
}
380+
379381
ctx.Data["__APIChangeRepoFilesOptions"] = changeFileOpts
380382
}
381383

0 commit comments

Comments
 (0)