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
This commit is contained in:
IGI-111 2019-09-23 19:38:06 +02:00 committed by Ben Lichtman
parent 7cc4e18aed
commit c56d400a17
3 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,7 @@
// Definitions by: Dolan Miu <https://github.com/dolanmiu>,
// Tobias Nießen <https://github.com/tniessen>,
// Pierre Vigier <https://github.com/pvigier>
// Jibril Saffi <https://github.com/IGI-111>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export { AnnotatedCommit } from './annotated-commit';

View File

@ -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

View File

@ -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<TreeEntry>;
/**
* Return an array of the entries in this tree (excluding its children).
*/