Skip to content

Commit 8202c65

Browse files
authored
Merge pull request #11 from KebanFiru/test/publish
bug fix
2 parents a459116 + 014de7f commit 8202c65

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)