From efc2561ca7aaf962d8dcb93e071331309600521f Mon Sep 17 00:00:00 2001 From: billytrend Date: Tue, 28 May 2019 13:40:14 -0700 Subject: [PATCH] Add start function to nodegit Tree.walk return type (#35698) * Add start function to Tree.walk return type * Add test --- types/nodegit/nodegit-tests.ts | 2 ++ types/nodegit/tree.d.ts | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index a908f8a58f..f611753448 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -13,6 +13,8 @@ const id = new Git.Oid(); const ref = new Git.Reference(); const tree = new Git.Tree(); +tree.walk().start(); + // AnnotatedCommit Tests Git.AnnotatedCommit.fromFetchhead(repo, "branch_name", "remote_url", id).then((annotatedCommit) => { diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index 50c29e8a3f..3232e5944c 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -58,7 +58,12 @@ export class Tree { /** * Recursively walk the tree in breadth-first order. Fires an event for each entry. */ - walk(blobsOnly?: boolean): NodeJS.EventEmitter; + walk(blobsOnly?: boolean): NodeJS.EventEmitter & { + /** + * Start walking the tree and emitting events. This should be called after event listeners have been attached. + */ + start: () => void; + }; /** * Return the path of this tree, like /lib/foo/bar *