@@ -5,6 +5,7 @@ package actions
55
66import (
77 "bytes"
8+ stdCtx "context"
89 "fmt"
910 "net/http"
1011 "slices"
@@ -245,7 +246,7 @@ func List(ctx *context.Context) {
245246 return
246247 }
247248
248- if err := loadIsRefDeleted (ctx , runs ); err != nil {
249+ if err := loadIsRefDeleted (ctx , ctx . Repo . Repository . ID , runs ); err != nil {
249250 log .Error ("LoadIsRefDeleted" , err )
250251 }
251252
@@ -273,7 +274,7 @@ func List(ctx *context.Context) {
273274
274275// loadIsRefDeleted loads the IsRefDeleted field for each run in the list.
275276// TODO: move this function to models/actions/run_list.go but now it will result in a circular import.
276- func loadIsRefDeleted (ctx * context .Context , runs actions_model.RunList ) error {
277+ func loadIsRefDeleted (ctx stdCtx .Context , repoID int64 , runs actions_model.RunList ) error {
277278 branches := make (container.Set [string ], len (runs ))
278279 for _ , run := range runs {
279280 refName := git .RefName (run .Ref )
@@ -285,14 +286,14 @@ func loadIsRefDeleted(ctx *context.Context, runs actions_model.RunList) error {
285286 return nil
286287 }
287288
288- branchInfos , err := git_model .GetBranches (ctx , ctx . Repo . Repository . ID , branches .Values (), false )
289+ branchInfos , err := git_model .GetBranches (ctx , repoID , branches .Values (), false )
289290 if err != nil {
290291 return err
291292 }
292293 branchSet := git_model .BranchesToNamesSet (branchInfos )
293294 for _ , run := range runs {
294295 refName := git .RefName (run .Ref )
295- if refName .IsBranch () && ! branchSet .Contains (run . Ref ) {
296+ if refName .IsBranch () && ! branchSet .Contains (refName . ShortName () ) {
296297 run .IsRefDeleted = true
297298 }
298299 }
0 commit comments