Adds compare with branch command

Adds branches quick pick
This commit is contained in:
Eric Amodio
2017-03-18 02:01:25 -04:00
parent 164cb2bfe0
commit 73bbbc1d5f
10 changed files with 149 additions and 5 deletions

View File

@@ -57,7 +57,7 @@ export class Git {
return data;
}
static async getVersionedFile(fileName: string, repoPath: string, branchOrSha: string) {
static async getVersionedFile(repoPath: string, fileName: string, branchOrSha: string) {
const data = await Git.show(repoPath, fileName, branchOrSha);
const suffix = Git.isSha(branchOrSha) ? branchOrSha.substring(0, 8) : branchOrSha;
@@ -70,7 +70,7 @@ export class Git {
return;
}
Logger.log(`getVersionedFile(${fileName}, ${repoPath}, ${branchOrSha}); destination=${destination}`);
Logger.log(`getVersionedFile('${repoPath}', '${fileName}', ${branchOrSha}); destination=${destination}`);
fs.appendFile(destination, data, err => {
if (err) {
reject(err);
@@ -127,6 +127,12 @@ export class Git {
return gitCommand(root, ...params, `--`, file);
}
static branch(repoPath: string) {
const params = [`branch`, `-a`];
return gitCommand(repoPath, ...params);
}
static diff_nameStatus(repoPath: string, sha1?: string, sha2?: string) {
const params = [`diff`, `--name-status`, `-M`];
if (sha1) {