forked from forgejo/forgejo
Merge branch 'dev' of github.com:gogits/gogs into dev
This commit is contained in:
commit
bbadbbdf68
16 changed files with 152 additions and 35 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue