Skip to content

Commit 014de7f

Browse files
committed
bug fix
1 parent 2f92bd6 commit 014de7f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/extension.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ export function activate(context: vscode.ExtensionContext) {
126126
return;
127127
}
128128

129-
const gitPath = path.join(rootPath, filePath);
129+
const gitPath = path.isAbsolute(filePath) ? filePath : path.join(rootPath, filePath);
130+
const fileUri = vscode.Uri.file(gitPath);
130131
const encode = (ref: string) =>
131-
vscode.Uri.parse(
132-
`git:${gitPath}?${encodeURIComponent(JSON.stringify({ path: gitPath, ref }))}`
133-
);
132+
fileUri.with({
133+
scheme: 'git',
134+
query: JSON.stringify({ path: fileUri.fsPath, ref })
135+
});
134136

135137
const left = encode(`${pick.hash}^`);
136138
const right = encode(pick.hash);

0 commit comments

Comments
 (0)