From 7a6edf09264465b7c3cb67ff5129341f17e98a9b Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 27 Jul 2020 01:28:22 -0400 Subject: [PATCH] Fixes resolveReference --- src/git/git.ts | 3 ++- src/git/gitService.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/git/git.ts b/src/git/git.ts index 5c63016..e89360c 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -890,13 +890,14 @@ export namespace Git { return data.length === 0 ? undefined : data.trim(); } - export async function log__find_object(repoPath: string, objectId: string) { + export async function log__find_object(repoPath: string, objectId: string, ref: string) { const data = await git( { cwd: repoPath, errors: GitErrorHandling.Ignore }, 'log', '-n1', '--format=%H', `--find-object=${objectId}`, + ref, ); return data.length === 0 ? undefined : data.trim(); } diff --git a/src/git/gitService.ts b/src/git/gitService.ts index ea502e8..b85e1b4 100644 --- a/src/git/gitService.ts +++ b/src/git/gitService.ts @@ -3162,7 +3162,7 @@ export class GitService implements Disposable { const blob = await Git.rev_parse__verify(repoPath, ref, fileName); if (blob == null) return ref; - return (await Git.log__find_object(repoPath, blob)) ?? ref; + return (await Git.log__find_object(repoPath, blob, ref)) ?? ref; } @log()