提交 19df280c 编写于 作者: J Joao Moreno

fixes #53849

上级 ee0a7a26
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册