|
|
@ -246,14 +246,17 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
repo := &Repository{ |
|
|
|
repo := &Repository{ |
|
|
|
OwnerId: user.Id, |
|
|
|
OwnerId: user.Id, |
|
|
|
Name: name, |
|
|
|
Name: name, |
|
|
|
LowerName: strings.ToLower(name), |
|
|
|
LowerName: strings.ToLower(name), |
|
|
|
Description: desc, |
|
|
|
Description: desc, |
|
|
|
IsPrivate: private, |
|
|
|
IsPrivate: private, |
|
|
|
IsBare: lang == "" && license == "" && !initReadme, |
|
|
|
IsBare: lang == "" && license == "" && !initReadme, |
|
|
|
DefaultBranch: "master", |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if !repo.IsBare { |
|
|
|
|
|
|
|
repo.DefaultBranch = "master" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
repoPath := RepoPath(user.Name, repo.Name) |
|
|
|
repoPath := RepoPath(user.Name, repo.Name) |
|
|
|
|
|
|
|
|
|
|
|
sess := orm.NewSession() |
|
|
|
sess := orm.NewSession() |
|
|
|