merge-processor

Functions

processMerge()

processMerge<T>(__namedParameters: { autoStage?: boolean; base?: unknown; config: Config<T>; filePath: string; format: string; logger: { debug: (fileId: string, msg: string) => void; error: (fileId: string, msg: string) => void; flush: () => Promise<void>; info: (fileId: string, msg: string) => void; warn: (fileId: string, msg: string) => void; }; normalizedConfig: NormalizedConfig; ours: unknown; theirs: unknown; }): Promise<{ conflicts: Conflict[]; success: boolean; }>

Defined in: merge-processor.ts:17

Common merge logic for processing a single file with ours/theirs/base data

Type Parameters

T

T extends string = InbuiltMergeStrategies

Parameters

__namedParameters
autoStage?

boolean = false

base?

unknown

config

Config<T>

filePath

string

format

string

logger

{ debug: (fileId: string, msg: string) => void; error: (fileId: string, msg: string) => void; flush: () => Promise<void>; info: (fileId: string, msg: string) => void; warn: (fileId: string, msg: string) => void; }

logger.debug

(fileId: string, msg: string) => void = ...

logger.error

(fileId: string, msg: string) => void = ...

logger.flush

() => Promise<void>

logger.info

(fileId: string, msg: string) => void = ...

logger.warn

(fileId: string, msg: string) => void = ...

normalizedConfig

NormalizedConfig

ours

unknown

theirs

unknown

Returns

Promise<{ conflicts: Conflict[]; success: boolean; }>


resolveGitMergeFiles()

resolveGitMergeFiles<T>(oursPath: string, basePath: string, theirsPath: string, config: Config<T>): Promise<never>

Defined in: merge-processor.ts:92

Resolves Git merge conflicts for a single file using the three-way merge approach. This function is designed to work as a Git merge driver.

Type Parameters

T

T extends string = InbuiltMergeStrategies

Parameters

oursPath

string

Path to the “ours” version of the file

basePath

string

Path to the common ancestor version of the file

theirsPath

string

Path to the “theirs” version of the file

config

Config<T> = ...

Configuration for conflict resolution

Returns

Promise<never>

Promise that resolves when merge is complete