mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
fixes #53849
This commit is contained in:
@@ -795,10 +795,10 @@ export class Repository {
|
||||
return parseLsFiles(stdout);
|
||||
}
|
||||
|
||||
async getGitRelativePath(treeish: string, relativePath: string): Promise<string> {
|
||||
async getGitRelativePath(ref: string, relativePath: string): Promise<string> {
|
||||
const relativePathLowercase = relativePath.toLowerCase();
|
||||
const dirname = path.posix.dirname(relativePath) + '/';
|
||||
const elements: { file: string; }[] = treeish ? await this.lstree(treeish, dirname) : await this.lsfiles(dirname);
|
||||
const elements: { file: string; }[] = ref ? await this.lstree(ref, dirname) : await this.lsfiles(dirname);
|
||||
const element = elements.filter(file => file.file.toLowerCase() === relativePathLowercase)[0];
|
||||
|
||||
if (!element) {
|
||||
|
||||
@@ -882,10 +882,6 @@ export class Repository implements Disposable {
|
||||
const defaultEncoding = configFiles.get<string>('encoding');
|
||||
const autoGuessEncoding = configFiles.get<boolean>('autoGuessEncoding');
|
||||
|
||||
if (ref === '') {
|
||||
ref = 'HEAD';
|
||||
}
|
||||
|
||||
try {
|
||||
return await this.repository.bufferString(`${ref}:${relativePath}`, defaultEncoding, autoGuessEncoding);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user