Adds new show repository status command

This commit is contained in:
Eric Amodio
2017-02-25 02:20:23 -05:00
parent bcfb0cd24d
commit 0a4cdd81eb
8 changed files with 336 additions and 78 deletions

View File

@@ -171,13 +171,18 @@ export default class Git {
return gitCommand(root, 'show', `${sha}:./${file}`);
}
static statusForFile(fileName: string, repoPath: string): Promise<string> {
static statusFile(fileName: string, repoPath: string): Promise<string> {
const [file, root]: [string, string] = Git.splitPath(Git.normalizePath(fileName), repoPath);
const params = ['status', file, '--short'];
return gitCommand(root, ...params);
}
static statusRepo(repoPath: string): Promise<string> {
const params = ['status', '--short'];
return gitCommand(repoPath, ...params);
}
static isUncommitted(sha: string) {
return UncommittedRegex.test(sha);
}