@@ -5,6 +5,7 @@ package actions
5
5
6
6
import (
7
7
"bytes"
8
+ stdCtx "context"
8
9
"fmt"
9
10
"net/http"
10
11
"slices"
@@ -245,7 +246,7 @@ func List(ctx *context.Context) {
245
246
return
246
247
}
247
248
248
- if err := loadIsRefDeleted (ctx , runs ); err != nil {
249
+ if err := loadIsRefDeleted (ctx , ctx . Repo . Repository . ID , runs ); err != nil {
249
250
log .Error ("LoadIsRefDeleted" , err )
250
251
}
251
252
@@ -273,7 +274,7 @@ func List(ctx *context.Context) {
273
274
274
275
// loadIsRefDeleted loads the IsRefDeleted field for each run in the list.
275
276
// 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 {
277
278
branches := make (container.Set [string ], len (runs ))
278
279
for _ , run := range runs {
279
280
refName := git .RefName (run .Ref )
@@ -285,14 +286,14 @@ func loadIsRefDeleted(ctx *context.Context, runs actions_model.RunList) error {
285
286
return nil
286
287
}
287
288
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 )
289
290
if err != nil {
290
291
return err
291
292
}
292
293
branchSet := git_model .BranchesToNamesSet (branchInfos )
293
294
for _ , run := range runs {
294
295
refName := git .RefName (run .Ref )
295
- if refName .IsBranch () && ! branchSet .Contains (run . Ref ) {
296
+ if refName .IsBranch () && ! branchSet .Contains (refName . ShortName () ) {
296
297
run .IsRefDeleted = true
297
298
}
298
299
}
0 commit comments