(ctx context.Context, env *environment.Environment, note string)
| 340 | } |
| 341 | |
| 342 | func (r *Repository) addGitNote(ctx context.Context, env *environment.Environment, note string) error { |
| 343 | worktreePath, err := r.WorktreePath(env.ID) |
| 344 | if err != nil { |
| 345 | return fmt.Errorf("failed to get worktree path: %w", err) |
| 346 | } |
| 347 | if err := r.lockManager.WithLock(ctx, LockTypeNotes, func() error { |
| 348 | _, err = RunGitCommand(ctx, worktreePath, "notes", "--ref", gitNotesLogRef, "append", "-m", note) |
| 349 | return err |
| 350 | }); err != nil { |
| 351 | return err |
| 352 | } |
| 353 | |
| 354 | return r.propagateGitNotes(ctx, gitNotesLogRef) |
| 355 | } |
| 356 | |
| 357 | func (r *Repository) currentUserBranch(ctx context.Context) (string, error) { |
| 358 | return RunGitCommand(ctx, r.userRepoPath, "branch", "--show-current") |
no test coverage detected