From 32581a7937486685fb2fbe30650168db8fd17576 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:53:17 +0100 Subject: [PATCH] Added Checkout --- types/nodegit/checkout.d.ts | 51 +++++++++++++++++++++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 53 insertions(+) create mode 100644 types/nodegit/checkout.d.ts diff --git a/types/nodegit/checkout.d.ts b/types/nodegit/checkout.d.ts new file mode 100644 index 0000000000..a7bc6d63fc --- /dev/null +++ b/types/nodegit/checkout.d.ts @@ -0,0 +1,51 @@ +import { Repository } from './repository'; +import { CheckoutOptions } from './checkout-options'; +import { Reference } from './reference'; +import { Oid } from './oid'; +import { Tree } from './tree'; +import { Commit } from './commit'; +import { Index } from './index'; + +export namespace Checkout { + enum NOTIFY { + NONE = 0, + CONFLICT = 1, + DIRTY = 2, + UPDATED = 4, + UNTRACKED = 8, + IGNORED = 16, + ALL = 65535 + } + + enum STRATEGY { + NONE = 0, + SAFE = 1, + FORCE = 2, + RECREATE_MISSING = 4, + ALLOW_CONFLICTS = 16, + REMOVE_UNTRACKED = 32, + REMOVE_IGNORED = 64, + UPDATE_ONLY = 128, + DONT_UPDATE_INDEX = 256, + NO_REFRESH = 512, + SKIP_UNMERGED = 1024, + USE_OURS = 2048, + USE_THEIRS = 4096, + DISABLE_PATHSPEC_MATCH = 8192, + SKIP_LOCKED_DIRECTORIES = 262144, + DONT_OVERWRITE_IGNORED = 524288, + CONFLICT_STYLE_MERGE = 1048576, + CONFLICT_STYLE_DIFF3 = 2097152, + DONT_REMOVE_EXISTING = 4194304, + DONT_WRITE_INDEX = 8388608, + UPDATE_SUBMODULES = 65536, + UPDATE_SUBMODULES_IF_CHANGED = 131072 + } +} + +export class Checkout { + static head(repo: Repository, options?: CheckoutOptions): Promise; + static index(repo: Repository, The: Index, options?: CheckoutOptions): Promise; + static initOptions(opts: CheckoutOptions, version: number): number; + static tree(repo: Repository, treeish: Oid | Tree | Commit | Reference, options?: CheckoutOptions): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index d69425fc75..36e823ec19 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -7,6 +7,7 @@ export { AnnotatedCommit } from './annotated-commit'; export { Blob } from './blob'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; +export { Checkout } from './checkout'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index b35a0c0e7a..607f154837 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -20,6 +20,7 @@ "blob.d.ts", "buf.d.ts", "checkout-options.d.ts", + "checkout.d.ts", "commit.d.ts", "config.d.ts", "convenient-patch.d.ts",