mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #47226 [nodegit] Fix Blame-related methods by @julien-c
* [nodegit] Fix Blame-related methods * Add basic test
This commit is contained in:
parent
82f3ed91c5
commit
00954267f7
16
types/nodegit/blame-hunk.d.ts
vendored
16
types/nodegit/blame-hunk.d.ts
vendored
@ -2,12 +2,12 @@ import { Oid } from './oid';
|
||||
import { Signature } from './signature';
|
||||
|
||||
export class BlameHunk {
|
||||
linesInHunk: number;
|
||||
finalCommitId: Oid;
|
||||
finalStartLineNumber: number;
|
||||
finalSignature: Signature;
|
||||
origCommitId: Oid;
|
||||
origPath: string;
|
||||
origStartLineNumber: number;
|
||||
origSignature: Signature;
|
||||
linesInHunk(): number;
|
||||
finalCommitId(): Oid;
|
||||
finalStartLineNumber(): number;
|
||||
finalSignature(): Signature;
|
||||
origCommitId(): Oid;
|
||||
origPath(): string;
|
||||
origStartLineNumber(): number;
|
||||
origSignature(): Signature;
|
||||
}
|
||||
|
||||
2
types/nodegit/blame.d.ts
vendored
2
types/nodegit/blame.d.ts
vendored
@ -21,7 +21,7 @@ export class Blame {
|
||||
* @param path - to the file to get the blame of
|
||||
* @param [options] - Options for the blame
|
||||
*/
|
||||
static file(repo: Repository, path: string, options?: BlameOptions): Blame;
|
||||
static file(repo: Repository, path: string, options?: BlameOptions): Promise<Blame>;
|
||||
/**
|
||||
* @param opts - The git_blame_options struct to initialize
|
||||
* @param version - Version of struct; pass GIT_BLAME_OPTIONS_VERSION
|
||||
|
||||
1
types/nodegit/index.d.ts
vendored
1
types/nodegit/index.d.ts
vendored
@ -5,6 +5,7 @@
|
||||
// Pierre Vigier <https://github.com/pvigier>
|
||||
// Jibril Saffi <https://github.com/IGI-111>
|
||||
// Benjamin Schuster-Boeckler <https://github.com/DaGaMs>
|
||||
// Julien Chaumond <https://github.com/julien-c>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export { AnnotatedCommit } from './annotated-commit';
|
||||
|
||||
@ -58,6 +58,11 @@ result = Git.Attr.value('attr');
|
||||
|
||||
const blameOptions = new Git.BlameOptions();
|
||||
|
||||
Git.Blame.file(repo, 'path').then(blame => {
|
||||
const hunk = blame.getHunkByLine(0);
|
||||
hunk.linesInHunk();
|
||||
});
|
||||
|
||||
Git.Branch.lookup(repo, 'branch_name', Git.Branch.BRANCH.LOCAL).then(reference => {
|
||||
// Use reference
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user