Skip to content

Commit acbacac

Browse files
committed
feat: implement getBlob
1 parent 6bbba76 commit acbacac

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,15 @@ export class AtomGitAPIService implements ICodeAPIService {
109109
}
110110
async getBlob(repo: IRepositoryModel, entry: EntryParam): Promise<Uint8Array> {
111111
const { path } = entry;
112+
const { ref } = repo;
112113
const res = await this.request<API.ResponseContentBlob>(
113-
`/repos/${this.getProjectPath(repo)}/contents/${path}`,
114+
`/repos/${this.getProjectPath(repo)}/contents`,
115+
{
116+
params: {
117+
ref,
118+
path: encodeURIComponent(path)
119+
}
120+
}
114121
);
115122

116123
const { content, encoding } = res;

packages/code-api/src/common/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export interface IRepositoryModel {
8080
owner: string;
8181
name: string;
8282
commit: string;
83+
ref?: string;
8384
}
8485

8586
export interface CommitParams {

0 commit comments

Comments
 (0)