UNPKG

1.97 kBTypeScriptView Raw
1import { Repository } from './repository';
2import { Oid } from './oid';
3import { Tree } from './tree';
4import { Commit } from './commit';
5import { Index } from './index';
6import { AnnotatedCommit } from './annotated-commit';
7import { CheckoutOptions } from './checkout-options';
8import { Oidarray } from './oid-array';
9import { MergeOptions } from './merge-options';
10import { MergeFileInput } from './merge-file-input';
11
12export namespace Merge {
13 const enum ANALYSIS {
14 NONE = 0,
15 NORMAL = 1,
16 UP_TO_DATE = 2,
17 FASTFORWARD = 4,
18 UNBORN = 8,
19 }
20
21 const enum FILE_FAVOR {
22 NORMAL = 0,
23 OURS = 1,
24 THEIRS = 2,
25 UNION = 3,
26 }
27
28 const enum FILE_FLAGS {
29 FILE_DEFAULT = 0,
30 FILE_STYLE_MERGE = 1,
31 FILE_STYLE_DIFF3 = 2,
32 FILE_SIMPLIFY_ALNUM = 4,
33 FILE_IGNORE_WHITESPACE = 8,
34 FILE_IGNORE_WHITESPACE_CHANGE = 16,
35 FILE_IGNORE_WHITESPACE_EOL = 32,
36 FILE_DIFF_PATIENCE = 64,
37 FILE_DIFF_MINIMAL = 128,
38 }
39
40 const enum PREFERENCE {
41 NONE = 0,
42 NO_FASTFORWARD = 1,
43 FASTFORWARD_ONLY = 2,
44 }
45
46 const enum TREE_FLAG {
47 TREE_FIND_RENAMES = 1,
48 }
49}
50
51export class Merge {
52 static merge(
53 repo: Repository,
54 theirHead: AnnotatedCommit,
55 mergeOpts?: MergeOptions,
56 checkoutOpts?: CheckoutOptions,
57 ): any;
58 static base(repo: Repository, one: Oid, two: Oid): Promise<Oid>;
59 static bases(repo: Repository, one: Oid, two: Oid): Promise<Oidarray>;
60 static commits(repo: Repository, ourCommit: Commit, theirCommit: Commit, options?: MergeOptions): any;
61 static fileInitInput(opts: MergeFileInput, version: number): number;
62 static initOptions(opts: MergeOptions, version: number): number;
63 static trees(
64 repo: Repository,
65 ancestorTree: Tree,
66 ourTree: Tree,
67 theirTree: Tree,
68 opts?: MergeOptions,
69 ): Promise<Index>;
70}