Changes previous diff to working diff if uncommit

This commit is contained in:
Eric Amodio
2017-02-16 12:25:48 -05:00
parent 4d0c18f330
commit b17c43ba9a
4 changed files with 26 additions and 1 deletions

View File

@@ -545,6 +545,17 @@ export default class GitProvider extends Disposable {
return locations;
}
async getStatusForFile(fileName: string, repoPath: string) {
Logger.log(`getStatusForFile('${fileName}', ${repoPath})`);
return (await Git.statusForFile(fileName, repoPath)).trim();
}
async isFileUncommitted(fileName: string, repoPath: string) {
Logger.log(`isFileUncommitted('${fileName}', ${repoPath})`);
const status = await this.getStatusForFile(fileName, repoPath);
return status && status.length;
}
async getVersionedFile(fileName: string, repoPath: string, sha: string) {
Logger.log(`getVersionedFile('${fileName}', ${repoPath}, ${sha})`);