MCPcopy
hub / github.com/dagger/container-use / addGitNote

Method addGitNote

repository/git.go:342–355  ·  view source on GitHub ↗
(ctx context.Context, env *environment.Environment, note string)

Source from the content-addressed store, hash-verified

340}
341
342func (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
357func (r *Repository) currentUserBranch(ctx context.Context) (string, error) {
358 return RunGitCommand(ctx, r.userRepoPath, "branch", "--show-current")

Callers 1

UpdateMethod · 0.95

Calls 4

WorktreePathMethod · 0.95
propagateGitNotesMethod · 0.95
RunGitCommandFunction · 0.85
WithLockMethod · 0.45

Tested by

no test coverage detected