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

Method commitWorktreeChanges

repository/git.go:387–405  ·  view source on GitHub ↗
(ctx context.Context, worktreePath, explanation string)

Source from the content-addressed store, hash-verified

385}
386
387func (r *Repository) commitWorktreeChanges(ctx context.Context, worktreePath, explanation string) error {
388 return r.lockManager.WithLock(ctx, LockTypeForkRepo, func() error {
389 status, err := RunGitCommand(ctx, worktreePath, "status", "--porcelain")
390 if err != nil {
391 return err
392 }
393
394 if strings.TrimSpace(status) == "" {
395 return nil
396 }
397
398 if err := r.addNonBinaryFiles(ctx, worktreePath); err != nil {
399 return err
400 }
401
402 _, err = RunGitCommand(ctx, worktreePath, "commit", "--allow-empty", "--allow-empty-message", "-m", explanation)
403 return err
404 })
405}
406
407// AI slop below!
408// this is just to keep us moving fast because big git repos get hard to work with

Callers 2

propagateToWorktreeMethod · 0.95

Calls 3

addNonBinaryFilesMethod · 0.95
RunGitCommandFunction · 0.85
WithLockMethod · 0.45

Tested by 1