Fix panic when no master branch

This commit is contained in:
Unknown 2014-05-01 12:03:10 -04:00
parent 0a187dbef5
commit 75109bbd65
6 changed files with 24 additions and 13 deletions

View file

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