Reference
import { /* ... */ } from 'git-edge';function
threeWayMergethreeWayMerge(repo: Repo, sourceRef: string, targetRef: string, opts?: MergeOpts): Promise<MergeResult>| Parameter | Type | Description |
|---|---|---|
opts.message? | string | Default `Merge ${sourceRef} into ${targetRef}`. |
opts.authorName? | string | Default "Git Edge". |
opts.authorEmail? | string | Default "git-edge@local". |
Returns: Promise<{ commitOid: string }>
Object-level three-way merge — no worktree. Throws GitMergeConflictError
on unresolved content conflicts. See
Three-way merge for the full decision
tree.
Parsed-object cache
Section titled “Parsed-object cache”function
createParsedObjectCachecreateParsedObjectCache(options?: ParsedObjectCacheOptions): ParsedObjectStore| Parameter | Type | Description |
|---|---|---|
options.maxSize? | number | Approximate byte budget; each entry is sized by walking its value (no serialization). Default 256 MiB. |
options.ttl? | number | Entry TTL in ms. Default 1 hour. |
Returns: ParsedObjectStore
A generic in-memory LRU for any JS value, keyed however you like. See the parsed-object cache guide.
ParsedObjectStore — the returned interface:
interface ParsedObjectStore { get<T extends object>(key: string): T | null; set<T extends object>(key: string, value: T): void; delete(key: string): void; invalidatePrefix(prefix: string): void;}Repo cache
Section titled “Repo cache”function
getRepoCachegetRepoCache(ownerKey: string, repoName: string): objectReturns: object
The long-lived isomorphic-git packfile cache for a repo, created on
first access. See
Repo cache.
function
invalidateRepoCacheinvalidateRepoCache(ownerKey: string, repoName: string): voidDrops a repo’s cached packfile state — call after any out-of-process storage rewrite.
Errors
Section titled “Errors”class GitMergeConflictError extends GitEdgeErrorThrown only by threeWayMerge. Carries conflictingPaths: string[].
| Export | Shape |
|---|---|
Repo |
{ fs: IsoGitFs; gitdir: string; cache?: object } |
MergeOpts |
{ message?, authorName?, authorEmail? } |
MergeResult |
{ commitOid: string } |
ParsedObjectCacheOptions |
{ maxSize?: number; ttl?: number } |