mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +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
|
httpMock
|
||||||
.scope(gerritEndpointUrl)
|
.scope(gerritEndpointUrl)
|
||||||
.get(
|
.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('{}'));
|
.reply(200, gerritFileResponse('{}'));
|
||||||
await expect(
|
await expect(
|
||||||
client.getFile('test/repo', 'main', 'renovate.json'),
|
client.getFile('test/repo', 'base/branch', 'renovate.json'),
|
||||||
).resolves.toBe('{}');
|
).resolves.toBe('{}');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -195,7 +195,7 @@ class GerritClient {
|
||||||
const base64Content = await this.gerritHttp.get(
|
const base64Content = await this.gerritHttp.get(
|
||||||
`a/projects/${encodeURIComponent(
|
`a/projects/${encodeURIComponent(
|
||||||
repo,
|
repo,
|
||||||
)}/branches/${branch}/files/${encodeURIComponent(fileName)}/content`,
|
)}/branches/${encodeURIComponent(branch)}/files/${encodeURIComponent(fileName)}/content`,
|
||||||
);
|
);
|
||||||
return Buffer.from(base64Content.body, 'base64').toString();
|
return Buffer.from(base64Content.body, 'base64').toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue