mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 14:36:25 +00:00
fix(git): aonly allow fast-forward merge (#4169)
fix(git): aonly allow fast-forward merge
This commit is contained in:
parent
709a2bc1ec
commit
ceebedca3f
2 changed files with 15 additions and 1 deletions
|
@ -338,7 +338,7 @@ export class Storage {
|
|||
await this._git!.reset('hard');
|
||||
await this._git!.checkout(['-B', branchName, 'origin/' + branchName]);
|
||||
await this._git!.checkout(this._config.baseBranch);
|
||||
await this._git!.merge([branchName]);
|
||||
await this._git!.merge(['--ff-only', branchName]);
|
||||
await this._git!.push('origin', this._config.baseBranch);
|
||||
}
|
||||
|
||||
|
|
|
@ -149,6 +149,20 @@ describe('platform/git/storage', () => {
|
|||
it('should throw if branch merge throws', async () => {
|
||||
await expect(git.mergeBranch('not_found')).rejects.toThrow();
|
||||
});
|
||||
it('should throw if branch merge is stale', async () => {
|
||||
expect.assertions(1);
|
||||
await git.setBranchPrefix('renovate/');
|
||||
await git.commitFilesToBranch(
|
||||
'test',
|
||||
[{ name: 'some-new-file', contents: 'some new-contents' }],
|
||||
'test mesage',
|
||||
'renovate/past_branch'
|
||||
);
|
||||
|
||||
await git.setBaseBranch('master');
|
||||
|
||||
await expect(git.mergeBranch('test')).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
describe('deleteBranch(branchName)', () => {
|
||||
it('should send delete', async () => {
|
||||
|
|
Loading…
Reference in a new issue