Skip to content

Commit 449396c

Browse files
author
winjo
committed
fix: 修复 github diff 报错问题
1 parent ee7b6bf commit 449396c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/code-api/src/github/github.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ export class GitHubAPIService implements ICodeAPIService {
328328
responseType: 'json',
329329
}
330330
);
331-
return Buffer.from(data.content, data.encoding);
331+
// Buffer toJSON 为 { type: 'Buffer', data: [] },通过 rpc 传输后无法自动恢复,ArrayBufferView 额外处理了,可以恢复
332+
return new Uint8Array(Buffer.from(data.content, data.encoding));
332333
},
333334

334335
getBranches: async (repo: IRepositoryModel): Promise<BranchOrTag[]> => {

0 commit comments

Comments
 (0)