|
|
|
@@ -1412,6 +1412,15 @@ func GetRepositoriesByForkID(forkID int64) ([]*Repository, error) { |
|
|
|
return getRepositoriesByForkID(x, forkID) |
|
|
|
} |
|
|
|
|
|
|
|
func getALLRepositories(e Engine) ([]*Repository, error) { |
|
|
|
repos := make([]*Repository, 0, 1000) |
|
|
|
return repos, e.Find(&repos) |
|
|
|
} |
|
|
|
|
|
|
|
func GetAllRepositories() ([]*Repository, error) { |
|
|
|
return getALLRepositories(x) |
|
|
|
} |
|
|
|
|
|
|
|
func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err error) { |
|
|
|
repo.LowerName = strings.ToLower(repo.Name) |
|
|
|
|
|
|
|
@@ -2414,6 +2423,7 @@ func updateRepositoryCols(e Engine, repo *Repository, cols ...string) error { |
|
|
|
} |
|
|
|
|
|
|
|
// UpdateRepositoryCols updates repository's columns |
|
|
|
// Notice: it will update the updated_unix automatically, be careful to use this |
|
|
|
func UpdateRepositoryCols(repo *Repository, cols ...string) error { |
|
|
|
return updateRepositoryCols(x, repo, cols...) |
|
|
|
} |
|
|
|
@@ -2443,3 +2453,11 @@ func (repo *Repository) IncreaseCloneCnt() { |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func UpdateRepositoryCommitNum(repo *Repository) error { |
|
|
|
if _,err := x.Exec("UPDATE `repository` SET num_commit = ? where id = ?", repo.NumCommit, repo.ID); err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
return nil |
|
|
|
} |