MCPcopy Create free account
hub / github.com/entireio/git-sync / Plan

Method Plan

client.go:47–60  ·  view source on GitHub ↗

Plan computes ref actions without pushing.

(ctx context.Context, req PlanRequest)

Source from the content-addressed store, hash-verified

45
46// Plan computes ref actions without pushing.
47func (c *Client) Plan(ctx context.Context, req PlanRequest) (PlanResult, error) {
48 if err := req.Validate(); err != nil {
49 return PlanResult{}, err
50 }
51 cfg, err := c.buildSyncConfig(ctx, req.Source, req.Target, req.Scope, req.Policy, req.CollectStats, true)
52 if err != nil {
53 return PlanResult{}, err
54 }
55 result, err := internalbridge.Run(ctx, cfg)
56 if err != nil {
57 return PlanResult{}, fmt.Errorf("plan: %w", err)
58 }
59 return internalbridge.FromSyncResult(result), nil
60}
61
62// Sync executes a sync between two remotes.
63func (c *Client) Sync(ctx context.Context, req SyncRequest) (SyncResult, error) {

Callers 1

newSyncLikeCmdFunction · 0.45

Calls 4

buildSyncConfigMethod · 0.95
RunFunction · 0.92
FromSyncResultFunction · 0.92
ValidateMethod · 0.45

Tested by

no test coverage detected