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

Function SyncConfig

internalbridge/config.go:75–95  ·  view source on GitHub ↗
(source Endpoint, sourceAuth EndpointAuth, target Endpoint, targetAuth EndpointAuth, scope RefScope, policy SyncPolicy, collectStats, dryRun bool, httpClient *http.Client)

Source from the content-addressed store, hash-verified

73}
74
75func SyncConfig(source Endpoint, sourceAuth EndpointAuth, target Endpoint, targetAuth EndpointAuth, scope RefScope, policy SyncPolicy, collectStats, dryRun bool, httpClient *http.Client) Config {
76 return Config{raw: syncer.Config{
77 Source: ToSyncerEndpoint(source, sourceAuth),
78 Target: ToSyncerEndpoint(target, targetAuth),
79 HTTPClient: httpClient,
80 Branches: append([]string(nil), scope.Branches...),
81 Mappings: ToValidationMappings(scope.Mappings),
82 AllRefs: scope.AllRefs,
83 ExcludeRefPrefixes: append([]string(nil), scope.ExcludeRefPrefixes...),
84 IncludeTags: policy.IncludeTags,
85 DryRun: dryRun,
86 ShowStats: collectStats,
87 Mode: operationModeString(policy.Mode),
88 ForceWithLease: policy.ForceWithLease,
89 ForceBlind: policy.ForceBlind,
90 Prune: policy.Prune,
91 BestEffort: policy.BestEffort,
92 ProtocolMode: protocolString(policy.Protocol),
93 MaterializedMaxObjects: syncer.DefaultMaterializedMaxObjects,
94 }}
95}
96
97func Probe(ctx context.Context, cfg Config) (syncer.ProbeResult, error) {
98 result, err := syncer.Probe(ctx, cfg.raw)

Callers 1

buildSyncConfigMethod · 0.92

Calls 4

ToSyncerEndpointFunction · 0.85
ToValidationMappingsFunction · 0.85
operationModeStringFunction · 0.70
protocolStringFunction · 0.70

Tested by

no test coverage detected