private static Conflict[] AutoResolveConflicts(Workspace workspace, string targetPath, MergeOption mergeOption) { var targetPaths = new[] {targetPath}; var conflicts = workspace.QueryConflicts(targetPaths, true); if (conflicts.IsNullOrEmpty()) return null; foreach (var conflict in conflicts) { TryResolve(workspace, conflict, mergeOption); } conflicts = workspace.QueryConflicts(targetPaths, true); if (conflicts.IsNullOrEmpty()) return null; workspace.AutoResolveValidConflicts(conflicts, AutoResolveOptions.AllSilent); return workspace.QueryConflicts(targetPaths, true); }