Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occured while loading renamed picture for checked out PR #6033

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/common/uri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,17 @@ export async function asTempStorageURI(uri: vscode.Uri, repository: Repository):
return;
}
const ref = uri.scheme === Schemes.Review ? commit : isBase ? baseCommit : headCommit;
const { object } = await repository.getObjectDetails(ref, uri.fsPath);

const absolutePath = pathUtils.join(repository.rootUri.fsPath, path).replace(/\\/g, '/');
const { object } = await repository.getObjectDetails(ref, absolutePath);
const { mimetype } = await repository.detectObjectType(object);

if (mimetype === 'text/plain') {
return;
}

if (ImageMimetypes.indexOf(mimetype) > -1) {
const contents = await repository.buffer(ref, uri.fsPath);
const contents = await repository.buffer(ref, absolutePath);
return TemporaryState.write(pathUtils.dirname(path), pathUtils.basename(path), contents);
}
} catch (err) {
Expand Down