You've already forked agentic-coding-workflow
feat(infra/git): clone/fetch/push/commit/status verbs + integration tests
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package git
|
||||
|
||||
import "context"
|
||||
|
||||
// Fetch 执行 git fetch --all --prune。dir 是 main_path 或 worktree path。
|
||||
func (r *DefaultRunner) Fetch(ctx context.Context, dir string, cred *Credential) error {
|
||||
ctx, cancel := withCtx(ctx, r.cfg.FetchTimeout)
|
||||
defer cancel()
|
||||
env, cleanup, err := credentialEnv(r.cfg.TmpDir, cred)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer cleanup()
|
||||
_, _, err = r.exec(ctx, dir, env, "fetch", "--all", "--prune")
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user