Git - Improve unsafe repository handling (#168568)

Improve unsafe repository handling by extracting the  repository path to be used when calling git config
This commit is contained in:
Ladislau Szomoru
2022-12-09 20:23:35 +01:00
committed by GitHub
parent 7e49103c7c
commit d97a30c701
3 changed files with 18 additions and 16 deletions

View File

@@ -686,9 +686,6 @@ export class Git {
}
async addSafeDirectory(repositoryPath: string): Promise<void> {
// safe.directory only supports paths with `/` as separator
repositoryPath = repositoryPath.replaceAll('\\', '/');
await this.exec(repositoryPath, ['config', '--global', '--add', 'safe.directory', repositoryPath]);
return;
}