mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 01:25:38 -05:00
Merge from vscode 1b314ab317fbff7d799b21754326b7d849889ceb
This commit is contained in:
@@ -419,7 +419,7 @@ export class Git {
|
||||
}
|
||||
|
||||
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'], { log: false });
|
||||
|
||||
// Keep trailing spaces which are part of the directory name
|
||||
const repoPath = path.normalize(result.stdout.trimLeft().replace(/[\r\n]+$/, ''));
|
||||
@@ -437,8 +437,7 @@ export class Git {
|
||||
try {
|
||||
const networkPath = await new Promise<string>(resolve =>
|
||||
realpath.native(`${letter}:`, { encoding: 'utf8' }, (err, resolvedPath) =>
|
||||
// eslint-disable-next-line eqeqeq
|
||||
resolve(err != null ? undefined : resolvedPath),
|
||||
resolve(err !== null ? undefined : resolvedPath),
|
||||
),
|
||||
);
|
||||
if (networkPath !== undefined) {
|
||||
@@ -1628,6 +1627,8 @@ export class Repository {
|
||||
err.gitErrorCode = GitErrorCodes.RemoteConnectionError;
|
||||
} else if (/^fatal: The current branch .* has no upstream branch/.test(err.stderr || '')) {
|
||||
err.gitErrorCode = GitErrorCodes.NoUpstreamBranch;
|
||||
} else if (/Permission.*denied/.test(err.stderr || '')) {
|
||||
err.gitErrorCode = GitErrorCodes.PermissionDenied;
|
||||
}
|
||||
|
||||
throw err;
|
||||
|
||||
Reference in New Issue
Block a user