aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repository/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/repository/init.go')
-rw-r--r--modules/repository/init.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/repository/init.go b/modules/repository/init.go
index cb353f2496..f079f72b77 100644
--- a/modules/repository/init.go
+++ b/modules/repository/init.go
@@ -195,9 +195,14 @@ func prepareRepoCommit(ctx context.Context, repo *repo_model.Repository, tmpDir,
// LICENSE
if len(opts.License) > 0 {
- data, err = options.License(opts.License)
+ data, err = getLicense(opts.License, &licenseValues{
+ Owner: repo.OwnerName,
+ Email: authorSig.Email,
+ Repo: repo.Name,
+ Year: time.Now().Format("2006"),
+ })
if err != nil {
- return fmt.Errorf("GetRepoInitFile[%s]: %w", opts.License, err)
+ return fmt.Errorf("getLicense[%s]: %w", opts.License, err)
}
if err = os.WriteFile(filepath.Join(tmpDir, "LICENSE"), data, 0o644); err != nil {