Browse Source

Fixes resolveReference

main
Eric Amodio 4 years ago
parent
commit
7a6edf0926
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      src/git/git.ts
  2. +1
    -1
      src/git/gitService.ts

+ 2
- 1
src/git/git.ts View File

@ -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<string>(
{ cwd: repoPath, errors: GitErrorHandling.Ignore },
'log',
'-n1',
'--format=%H',
`--find-object=${objectId}`,
ref,
);
return data.length === 0 ? undefined : data.trim();
}

+ 1
- 1
src/git/gitService.ts View File

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

Loading…
Cancel
Save