mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 18:58:38 +00:00
Merge branch 'dev' of github.com:gogits/gogs into dev
This commit is contained in:
@@ -56,6 +56,25 @@ func GetBranches(userName, repoName string) ([]string, error) {
|
||||
return brs, nil
|
||||
}
|
||||
|
||||
// GetTags returns all tags of given repository.
|
||||
func GetTags(userName, repoName string) ([]string, error) {
|
||||
repo, err := git.OpenRepository(RepoPath(userName, repoName))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
refs, err := repo.AllTags()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
tags := make([]string, len(refs))
|
||||
for i, ref := range refs {
|
||||
tags[i] = ref.Name
|
||||
}
|
||||
return tags, nil
|
||||
}
|
||||
|
||||
func IsBranchExist(userName, repoName, branchName string) bool {
|
||||
repo, err := git.OpenRepository(RepoPath(userName, repoName))
|
||||
if err != nil {
|
||||
|
@@ -74,6 +74,7 @@ type Repository struct {
|
||||
NumStars int
|
||||
NumForks int
|
||||
NumIssues int
|
||||
NumReleases int `xorm:"NOT NULL"`
|
||||
NumClosedIssues int
|
||||
NumOpenIssues int `xorm:"-"`
|
||||
IsPrivate bool
|
||||
@@ -513,6 +514,7 @@ func NotifyWatchers(act *Action) error {
|
||||
continue
|
||||
}
|
||||
|
||||
act.Id = 0
|
||||
act.UserId = watches[i].UserId
|
||||
if _, err = orm.InsertOne(act); err != nil {
|
||||
return errors.New("repo.NotifyWatchers(create action): " + err.Error())
|
||||
|
Reference in New Issue
Block a user