(ctx context.Context, ref string)
| 275 | return nil |
| 276 | } |
| 277 | func (r *Repository) propagateGitNotes(ctx context.Context, ref string) error { |
| 278 | fullRef := fmt.Sprintf("refs/notes/%s", ref) |
| 279 | |
| 280 | return r.lockManager.WithLock(ctx, LockTypeUserRepo, func() error { |
| 281 | fetch := func() error { |
| 282 | _, err := RunGitCommand(ctx, r.userRepoPath, "fetch", containerUseRemote, fullRef+":"+fullRef) |
| 283 | return err |
| 284 | } |
| 285 | |
| 286 | if err := fetch(); err != nil { |
| 287 | if strings.Contains(err.Error(), "[rejected]") { |
| 288 | if _, err := RunGitCommand(ctx, r.userRepoPath, "update-ref", "-d", fullRef); err == nil { |
| 289 | return fetch() |
| 290 | } |
| 291 | } |
| 292 | return err |
| 293 | } |
| 294 | return nil |
| 295 | }) |
| 296 | } |
| 297 | |
| 298 | func (r *Repository) saveState(ctx context.Context, env *environment.Environment) error { |
| 299 | state, err := env.State.Marshal() |
no test coverage detected