From c56d400a178632deee6d4270c3f656b15f04eef1 Mon Sep 17 00:00:00 2001 From: IGI-111 Date: Mon, 23 Sep 2019 19:38:06 +0200 Subject: [PATCH] Fix nodegit Tree#getEntry return type (#38276) As per the documentation, Tree#getEntry is an async function and thus returns a Promise. See: https://www.nodegit.org/api/tree/#getEntry --- types/nodegit/index.d.ts | 1 + types/nodegit/nodegit-tests.ts | 3 +++ types/nodegit/tree.d.ts | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c0e18853a6..81004f099b 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Dolan Miu , // Tobias Nießen , // Pierre Vigier +// Jibril Saffi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export { AnnotatedCommit } from './annotated-commit'; diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index f611753448..2b8eb1451c 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -14,6 +14,9 @@ const ref = new Git.Reference(); const tree = new Git.Tree(); tree.walk().start(); +tree.getEntry("/").then(entry => { + // Use entry +}); // AnnotatedCommit Tests diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index 3232e5944c..4546316930 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -50,7 +50,7 @@ export class Tree { /** * Get an entry at a path. Unlike by name, this takes a fully qualified path, like /foo/bar/baz.javascript */ - getEntry(filePath: string): TreeEntry; + getEntry(filePath: string): Promise; /** * Return an array of the entries in this tree (excluding its children). */