Attempts to fix #58 - work with sub-modules

Also fixes issue with nested repos
This commit is contained in:
Eric Amodio
2017-04-01 00:58:09 -04:00
parent 7ce5a396a1
commit d3af67b21b
21 changed files with 38 additions and 25 deletions

View File

@@ -668,13 +668,10 @@ export class GitService extends Disposable {
return log && log.repoPath;
}
async getRepoPathFromUri(uri?: Uri, fallbackRepoPath?: string): Promise<string | undefined> {
if (!(uri instanceof Uri)) return fallbackRepoPath;
async getRepoPathFromUri(uri: Uri | undefined): Promise<string | undefined> {
if (!(uri instanceof Uri)) return this.repoPath;
const gitUri = await GitUri.fromUri(uri, this);
if (gitUri.repoPath) return gitUri.repoPath;
return (await this.getRepoPathFromFile(gitUri.fsPath)) || fallbackRepoPath;
return (await GitUri.fromUri(uri, this)).repoPath || this.repoPath;
}
async getStashList(repoPath: string): Promise<IGitStash> {