fix broken hooks

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ committed 2026-04-02 20:00:58 -04:00
1 parent ae8a64cd74
commit 37768f16aa
53 files changed
+270 -175

No files matched your search

+1 -1
View File
@@ -148,7 +148,7 @@ func (issue *Issue) getCrossReferences(stdCtx context.Context, ctx *crossReferen
refRepo = ctx.OrigIssue.Repo
} else {
// Issues in other repositories
refRepo, err = repo_model.GetRepositoryByOwnerAndName(stdCtx, ref.Owner, ref.Name)
refRepo, err = repo_model.GetRepositoryByOwnerAndName(stdCtx, ref.Owner, ref.Name, ref.GroupID)
if err != nil {
if repo_model.IsErrRepoNotExist(err) {
continue
+5 -3
View File
@@ -807,11 +807,12 @@ func (err ErrRepoNotExist) Unwrap() error {
}
// GetRepositoryByOwnerAndName returns the repository by given owner name and repo name
func GetRepositoryByOwnerAndName(ctx context.Context, ownerName, repoName string) (*Repository, error) {
func GetRepositoryByOwnerAndName(ctx context.Context, ownerName, repoName string, groupID int64) (*Repository, error) {
var repo Repository
has, err := db.GetEngine(ctx).Table("repository").Select("repository.*").
Join("INNER", "`user`", "`user`.id = repository.owner_id").
Where("repository.lower_name = ?", strings.ToLower(repoName)).
And("`repository`.group_id = ?", groupID).
And("`user`.lower_name = ?", strings.ToLower(ownerName)).
Get(&repo)
if err != nil {
@@ -823,10 +824,11 @@ func GetRepositoryByOwnerAndName(ctx context.Context, ownerName, repoName string
}
// GetRepositoryByName returns the repository by given name under user if exists.
func GetRepositoryByName(ctx context.Context, ownerID int64, name string) (*Repository, error) {
func GetRepositoryByName(ctx context.Context, ownerID, groupID int64, name string) (*Repository, error) {
var repo Repository
has, err := db.GetEngine(ctx).
Where("`owner_id`=?", ownerID).
And("`group_id`=?", groupID).
And("`lower_name`=?", strings.ToLower(name)).
NoAutoCondition().
Get(&repo)
@@ -844,7 +846,7 @@ func GetRepositoryByURL(ctx context.Context, repoURL string) (*Repository, error
if err != nil || ret.OwnerName == "" {
return nil, errors.New("unknown or malformed repository URL")
}
return GetRepositoryByOwnerAndName(ctx, ret.OwnerName, ret.RepoName)
return GetRepositoryByOwnerAndName(ctx, ret.OwnerName, ret.RepoName, ret.GroupID)
}
// GetRepositoryByURLRelax also accepts an SSH clone URL without user part