| 129 | type PlanResult = SyncResult |
| 130 | |
| 131 | func FromProbeResult(result syncer.ProbeResult) ProbeResult { |
| 132 | out := ProbeResult{ |
| 133 | SourceURL: result.SourceURL, |
| 134 | TargetURL: result.TargetURL, |
| 135 | RequestedMode: result.RequestedMode, |
| 136 | Protocol: result.Protocol, |
| 137 | RefPrefixes: append([]string(nil), result.RefPrefixes...), |
| 138 | Capabilities: append([]string(nil), result.Capabilities...), |
| 139 | TargetCaps: append([]string(nil), result.TargetCaps...), |
| 140 | Refs: make([]RefInfo, 0, len(result.Refs)), |
| 141 | SourceHEAD: result.SourceHEAD.String(), |
| 142 | Stats: FromStats(result.Stats), |
| 143 | Measurement: FromMeasurement(result.Measurement), |
| 144 | } |
| 145 | for _, ref := range result.Refs { |
| 146 | out.Refs = append(out.Refs, RefInfo{Name: ref.Name, Hash: ref.Hash.String()}) |
| 147 | } |
| 148 | return out |
| 149 | } |
| 150 | |
| 151 | func FromSyncResult(result syncer.Result) SyncResult { |
| 152 | out := SyncResult{ |