Skip to content

Commit

Permalink
fix: Fixed changelists for externals (close JohnstonCode#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jun 3, 2019
1 parent 5577bc2 commit e387d8a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,28 @@ export class Model implements IDisposable {
}

public async getRepositoryFromUri(uri: Uri): Promise<Repository | null> {
for (const liveRepository of this.openRepositories) {

// Sort by path length (First external and ignored over root)
const open = this.openRepositories.sort(
(a, b) => b.repository.workspaceRoot.length - a.repository.workspaceRoot.length
);

for (const liveRepository of open) {
const repository = liveRepository.repository;

// Ignore path is not child (fix for multiple externals)
if (!isDescendant(repository.workspaceRoot, uri.fsPath)) {
continue;
}

try {
const path = normalizePath(uri.fsPath);

await repository.info(path);

return repository;
} catch (error) {
console.error();
// Ignore
}
}

Expand Down

0 comments on commit e387d8a

Please sign in to comment.