@@ -485,26 +485,18 @@ func ChangeFiles(ctx *context.APIContext) {
485485 Message : apiOpts .Message ,
486486 OldBranch : apiOpts .BranchName ,
487487 NewBranch : apiOpts .NewBranchName ,
488- Committer : & files_service.IdentityOptions {
489- GitUserName : apiOpts .Committer .Name ,
490- GitUserEmail : apiOpts .Committer .Email ,
488+ Committer : & git.Signature {
489+ Name : apiOpts .Committer .Name ,
490+ Email : apiOpts .Committer .Email ,
491+ When : apiOpts .Dates .Committer ,
491492 },
492- Author : & files_service.IdentityOptions {
493- GitUserName : apiOpts .Author .Name ,
494- GitUserEmail : apiOpts .Author .Email ,
495- },
496- Dates : & files_service.CommitDateOptions {
497- Author : apiOpts .Dates .Author ,
498- Committer : apiOpts .Dates .Committer ,
493+ Author : & git.Signature {
494+ Name : apiOpts .Author .Name ,
495+ Email : apiOpts .Author .Email ,
496+ When : apiOpts .Dates .Author ,
499497 },
500498 Signoff : apiOpts .Signoff ,
501499 }
502- if opts .Dates .Author .IsZero () {
503- opts .Dates .Author = time .Now ()
504- }
505- if opts .Dates .Committer .IsZero () {
506- opts .Dates .Committer = time .Now ()
507- }
508500
509501 if opts .Message == "" {
510502 opts .Message = changeFilesCommitMessage (ctx , files )
@@ -582,26 +574,18 @@ func CreateFile(ctx *context.APIContext) {
582574 Message : apiOpts .Message ,
583575 OldBranch : apiOpts .BranchName ,
584576 NewBranch : apiOpts .NewBranchName ,
585- Committer : & files_service.IdentityOptions {
586- GitUserName : apiOpts .Committer .Name ,
587- GitUserEmail : apiOpts .Committer .Email ,
577+ Committer : & git.Signature {
578+ Name : apiOpts .Committer .Name ,
579+ Email : apiOpts .Committer .Email ,
580+ When : apiOpts .Dates .Committer ,
588581 },
589- Author : & files_service.IdentityOptions {
590- GitUserName : apiOpts .Author .Name ,
591- GitUserEmail : apiOpts .Author .Email ,
592- },
593- Dates : & files_service.CommitDateOptions {
594- Author : apiOpts .Dates .Author ,
595- Committer : apiOpts .Dates .Committer ,
582+ Author : & git.Signature {
583+ Name : apiOpts .Author .Name ,
584+ Email : apiOpts .Author .Email ,
585+ When : apiOpts .Dates .Author ,
596586 },
597587 Signoff : apiOpts .Signoff ,
598588 }
599- if opts .Dates .Author .IsZero () {
600- opts .Dates .Author = time .Now ()
601- }
602- if opts .Dates .Committer .IsZero () {
603- opts .Dates .Committer = time .Now ()
604- }
605589
606590 if opts .Message == "" {
607591 opts .Message = changeFilesCommitMessage (ctx , opts .Files )
@@ -685,26 +669,18 @@ func UpdateFile(ctx *context.APIContext) {
685669 Message : apiOpts .Message ,
686670 OldBranch : apiOpts .BranchName ,
687671 NewBranch : apiOpts .NewBranchName ,
688- Committer : & files_service.IdentityOptions {
689- GitUserName : apiOpts .Committer .Name ,
690- GitUserEmail : apiOpts .Committer .Email ,
672+ Committer : & git.Signature {
673+ Name : apiOpts .Committer .Name ,
674+ Email : apiOpts .Committer .Email ,
675+ When : apiOpts .Dates .Committer ,
691676 },
692- Author : & files_service.IdentityOptions {
693- GitUserName : apiOpts .Author .Name ,
694- GitUserEmail : apiOpts .Author .Email ,
695- },
696- Dates : & files_service.CommitDateOptions {
697- Author : apiOpts .Dates .Author ,
698- Committer : apiOpts .Dates .Committer ,
677+ Author : & git.Signature {
678+ Name : apiOpts .Author .Name ,
679+ Email : apiOpts .Author .Email ,
680+ When : apiOpts .Dates .Author ,
699681 },
700682 Signoff : apiOpts .Signoff ,
701683 }
702- if opts .Dates .Author .IsZero () {
703- opts .Dates .Author = time .Now ()
704- }
705- if opts .Dates .Committer .IsZero () {
706- opts .Dates .Committer = time .Now ()
707- }
708684
709685 if opts .Message == "" {
710686 opts .Message = changeFilesCommitMessage (ctx , opts .Files )
@@ -844,26 +820,18 @@ func DeleteFile(ctx *context.APIContext) {
844820 Message : apiOpts .Message ,
845821 OldBranch : apiOpts .BranchName ,
846822 NewBranch : apiOpts .NewBranchName ,
847- Committer : & files_service.IdentityOptions {
848- GitUserName : apiOpts .Committer .Name ,
849- GitUserEmail : apiOpts .Committer .Email ,
823+ Committer : & git.Signature {
824+ Name : apiOpts .Committer .Name ,
825+ Email : apiOpts .Committer .Email ,
826+ When : apiOpts .Dates .Committer ,
850827 },
851- Author : & files_service.IdentityOptions {
852- GitUserName : apiOpts .Author .Name ,
853- GitUserEmail : apiOpts .Author .Email ,
854- },
855- Dates : & files_service.CommitDateOptions {
856- Author : apiOpts .Dates .Author ,
857- Committer : apiOpts .Dates .Committer ,
828+ Author : & git.Signature {
829+ Name : apiOpts .Author .Name ,
830+ Email : apiOpts .Author .Email ,
831+ When : apiOpts .Dates .Author ,
858832 },
859833 Signoff : apiOpts .Signoff ,
860834 }
861- if opts .Dates .Author .IsZero () {
862- opts .Dates .Author = time .Now ()
863- }
864- if opts .Dates .Committer .IsZero () {
865- opts .Dates .Committer = time .Now ()
866- }
867835
868836 if opts .Message == "" {
869837 opts .Message = changeFilesCommitMessage (ctx , opts .Files )
0 commit comments