MCPcopy Create free account
hub / github.com/driangle/taskmd / resolveConflict

Method resolveConflict

apps/cli/internal/sync/engine.go:218–236  ·  view source on GitHub ↗
(
	action SyncAction,
	ext ExternalTask,
	mapped MappedTask,
	extHash string,
	ts TaskState,
	state *SyncState,
	now time.Time,
)

Source from the content-addressed store, hash-verified

216}
217
218func (e *Engine) resolveConflict(
219 action SyncAction,
220 ext ExternalTask,
221 mapped MappedTask,
222 extHash string,
223 ts TaskState,
224 state *SyncState,
225 now time.Time,
226) (SyncAction, error) {
227 switch e.ConflictStrategy {
228 case ConflictRemote:
229 return e.applyExternalUpdate(action, ext, mapped, extHash, ts, state, now)
230 case ConflictLocal:
231 return e.acceptLocal(action, extHash, ts, state, now)
232 default:
233 action.Reason = "conflict"
234 return action, nil
235 }
236}
237
238func (e *Engine) acceptLocal(
239 action SyncAction,

Callers 1

updateTaskMethod · 0.95

Calls 2

applyExternalUpdateMethod · 0.95
acceptLocalMethod · 0.95

Tested by

no test coverage detected