From afd815531f5f1e06c458ec4d52adee9c3fba15cc Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 14 Sep 2018 02:07:59 -0400 Subject: [PATCH] Removes dead code --- src/git/git.ts | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/src/git/git.ts b/src/git/git.ts index 7b634d9..e0f743d 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -197,48 +197,6 @@ export class Git { ); } - // static async getVersionedFile(repoPath: string | undefined, fileName: string, ref: string) { - // const buffer = await Git.show(repoPath, fileName, ref, { encoding: 'buffer' }); - // if (buffer === undefined) return undefined; - - // if (Git.isStagedUncommitted(ref)) { - // ref = ''; - // } - - // const suffix = Strings.truncate( - // Strings.sanitizeForFileSystem(Git.isSha(ref) ? Git.shortenSha(ref)! : ref), - // 50, - // '' - // ); - // const ext = path.extname(fileName); - - // const tmp = await import('tmp'); - // return new Promise((resolve, reject) => { - // tmp.file( - // { prefix: `${path.basename(fileName, ext)}-${suffix}__`, postfix: ext }, - // (err, destination, fd, cleanupCallback) => { - // if (err) { - // reject(err); - // return; - // } - - // Logger.log(`getVersionedFile[${destination}]('${repoPath}', '${fileName}', ${ref})`); - // fs.appendFile(destination, buffer, { encoding: 'binary' }, err => { - // if (err) { - // reject(err); - // return; - // } - - // const ReadOnly = 0o100444; // 33060 0b1000000100100100 - // fs.chmod(destination, ReadOnly, err => { - // resolve(destination); - // }); - // }); - // } - // ); - // }); - // } - static isResolveRequired(sha: string) { return Git.isSha(sha) && !Git.shaStrictRegex.test(sha); } @@ -728,7 +686,7 @@ export class Git { const args = ref.endsWith(':') ? `${ref}./${file}` : `${ref}:./${file}`; try { - const data = await git(opts, 'show', args, '--'); // , '--binary', '--no-textconv' + const data = await git(opts, 'show', args, '--'); return data; } catch (ex) {