This commit is contained in:
Unknown 2014-05-16 13:41:08 -04:00
parent 16e162b669
commit 956f011dd3
7 changed files with 43 additions and 14 deletions

View file

@ -125,8 +125,8 @@ func (repo *Repository) GetOwner() (err error) {
}
// IsRepositoryExist returns true if the repository with given name under user has already existed.
func IsRepositoryExist(user *User, repoName string) (bool, error) {
repo := Repository{OwnerId: user.Id}
func IsRepositoryExist(u *User, repoName string) (bool, error) {
repo := Repository{OwnerId: u.Id}
has, err := orm.Where("lower_name = ?", strings.ToLower(repoName)).Get(&repo)
if err != nil {
return has, err
@ -134,7 +134,7 @@ func IsRepositoryExist(user *User, repoName string) (bool, error) {
return false, nil
}
return com.IsDir(RepoPath(user.Name, repoName)), nil
return com.IsDir(RepoPath(u.Name, repoName)), nil
}
var (