mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix(platform/gerrit): URI encode branch in gerrit's getFile() (#30753)
This commit is contained in:
parent
eccb4d5714
commit
d554483f88
2 changed files with 3 additions and 3 deletions
|
@ -415,11 +415,11 @@ describe('modules/platform/gerrit/client', () => {
|
|||
httpMock
|
||||
.scope(gerritEndpointUrl)
|
||||
.get(
|
||||
'/a/projects/test%2Frepo/branches/main/files/renovate.json/content',
|
||||
'/a/projects/test%2Frepo/branches/base%2Fbranch/files/renovate.json/content',
|
||||
)
|
||||
.reply(200, gerritFileResponse('{}'));
|
||||
await expect(
|
||||
client.getFile('test/repo', 'main', 'renovate.json'),
|
||||
client.getFile('test/repo', 'base/branch', 'renovate.json'),
|
||||
).resolves.toBe('{}');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -195,7 +195,7 @@ class GerritClient {
|
|||
const base64Content = await this.gerritHttp.get(
|
||||
`a/projects/${encodeURIComponent(
|
||||
repo,
|
||||
)}/branches/${branch}/files/${encodeURIComponent(fileName)}/content`,
|
||||
)}/branches/${encodeURIComponent(branch)}/files/${encodeURIComponent(fileName)}/content`,
|
||||
);
|
||||
return Buffer.from(base64Content.body, 'base64').toString();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue