This commit is contained in:
Joao Moreno
2018-07-09 10:37:51 +02:00
parent ee0a7a265d
commit 19df280c7f
2 changed files with 2 additions and 6 deletions

View File

@@ -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) {