-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.d.ts
48 lines (46 loc) · 1.64 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
declare function gitRepoInfo(gitPath?: string): gitRepoInfo.GitRepoInfo;
declare namespace gitRepoInfo {
export interface GitRepoInfo {
/** The current branch */
branch: string;
/** SHA of the current commit */
sha: string;
/** The first 10 chars of the current SHA */
abbreviatedSha: string;
/** The tag for the current SHA (or `null` if no tag exists) */
tag: string | null;
/** Tag for the closest tagged ancestor (or `null` if no ancestor is tagged) */
lastTag: string | null;
/**
* Number of commits since the closest tagged ancestor.
* `0` if this commit is tagged, or `Infinity` if no ancestor is tagged.
*/
commitsSinceLastTag: number;
/** The committer of the current SHA */
committer: string;
/** The commit date of the current SHA */
committerDate: string;
/** The author for the current SHA */
author: string;
/** The authored date for the current SHA */
authorDate: string;
/** The commit message for the current SHA */
commitMessage: string;
/**
* The root directory for the Git repo or submodule.
* If in a worktree, this is the directory containing the original copy, not the worktree.
*/
root: string;
/**
* The directory containing Git metadata for this repo or submodule.
* If in a worktree, this is the primary Git directory for the repo, not the worktree-specific one.
*/
commonGitDir: string;
/**
* If in a worktree, the directory containing Git metadata specific to this worktree.
* Otherwise, this is the same as `commonGitDir`.
*/
worktreeGitDir: string;
}
}
export = gitRepoInfo;