1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-19 16:58:37 +00:00

#1545 prevent duplicated refs of issues in single commit

This commit is contained in:
Unknwon
2015-09-03 04:34:08 -04:00
parent 1fd5f8edf8
commit b6131793da
3 changed files with 51 additions and 88 deletions

View File

@@ -1105,15 +1105,12 @@ func DeleteRepository(uid, repoID int64) error {
// See https://help.github.com/articles/writing-on-github#references for more information on the syntax.
func GetRepositoryByRef(ref string) (*Repository, error) {
n := strings.IndexByte(ref, byte('/'))
if n < 2 {
return nil, ErrInvalidReference
}
userName, repoName := ref[:n], ref[n+1:]
user, err := GetUserByName(userName)
if err != nil {
return nil, err
}