mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
nodegit: Fix return type of Commit#amend
This commit is contained in:
2
types/nodegit/commit.d.ts
vendored
2
types/nodegit/commit.d.ts
vendored
@@ -21,7 +21,7 @@ export class Commit {
|
||||
static lookupPrefix(repo: Repository, id: Oid, len: number): Promise<Commit>;
|
||||
static createWithSignature(repo: Repository, commitContent: string, signature: string, signatureField: string): Promise<Oid>;
|
||||
|
||||
amend(updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree): Oid;
|
||||
amend(updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree): Promise<Oid>;
|
||||
author(): Signature;
|
||||
committer(): Signature;
|
||||
|
||||
|
||||
4
types/nodegit/index.d.ts
vendored
4
types/nodegit/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for nodegit 0.18
|
||||
// Type definitions for nodegit 0.22
|
||||
// Project: https://github.com/nodegit/nodegit
|
||||
// Definitions by: Dolan Miu <https://github.com/dolanmiu>
|
||||
// Definitions by: Dolan Miu <https://github.com/dolanmiu>, Tobias Nießen <https://github.com/tniessen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export { AnnotatedCommit } from './annotated-commit';
|
||||
|
||||
@@ -11,6 +11,7 @@ Git.Repository.init("path", 0).then((repository) => {
|
||||
const repo = new Git.Repository();
|
||||
const id = new Git.Oid();
|
||||
const ref = new Git.Reference();
|
||||
const tree = new Git.Tree();
|
||||
|
||||
// AnnotatedCommit Tests
|
||||
|
||||
@@ -52,6 +53,11 @@ Git.Branch.lookup(repo, "branch_name", Git.Branch.BRANCH.LOCAL).then((reference)
|
||||
// Use reference
|
||||
});
|
||||
|
||||
repo.getCommit("0123456789abcdef0123456789abcdef").then((commit) => {
|
||||
const sig = Git.Signature.now('John Doe', 'jd@example.com');
|
||||
const newCommit: Promise<Git.Oid> = commit.amend('ref', sig, sig, 'utf8', 'message', tree);
|
||||
});
|
||||
|
||||
const signature = Git.Signature.now("name", "email");
|
||||
signature.name();
|
||||
signature.email();
|
||||
|
||||
Reference in New Issue
Block a user