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"
|
||||
|
||||
// Push 推送 dir 当前 branch 到 origin/<branch>。
|
||||
func (r *DefaultRunner) Push(ctx context.Context, dir, branch string, cred *Credential) error {
|
||||
ctx, cancel := withCtx(ctx, r.cfg.PushTimeout)
|
||||
defer cancel()
|
||||
env, cleanup, err := credentialEnv(r.cfg.TmpDir, cred)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer cleanup()
|
||||
_, _, err = r.exec(ctx, dir, env, "push", "-u", "origin", branch)
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user