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()