mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Merge pull request #82038 from jeanp413/fix-81158
Fix git repository not detected if root folder ends in [space]
This commit is contained in:
commit
ad9bce8978
|
@ -401,7 +401,8 @@ export class Git {
|
||||||
|
|
||||||
async getRepositoryRoot(repositoryPath: string): Promise<string> {
|
async getRepositoryRoot(repositoryPath: string): Promise<string> {
|
||||||
const result = await this.exec(repositoryPath, ['rev-parse', '--show-toplevel']);
|
const result = await this.exec(repositoryPath, ['rev-parse', '--show-toplevel']);
|
||||||
return path.normalize(result.stdout.trim());
|
// Keep trailing spaces which are part of the directory name
|
||||||
|
return path.normalize(result.stdout.trimLeft().replace(/(\r\n|\r|\n)+$/, ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getRepositoryDotGit(repositoryPath: string): Promise<string> {
|
async getRepositoryDotGit(repositoryPath: string): Promise<string> {
|
||||||
|
|
Loading…
Reference in a new issue