Modify GitEngine and add test

This commit is contained in:
Cesar Costas 2022-11-30 01:07:09 +00:00 committed by GitHub
parent 4471fc9595
commit e7fcf25566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -228,6 +228,13 @@ describe('Git', function() {
);
});
it('if squash is specified, will always make a squash merge commit', function() {
return expectTreeAsync(
'git commit; go -b side HEAD~1; git commit; git merge main; go main; git merge side --squash',
'{"branches":{"main":{"target":"C5","id":"main","remoteTrackingBranchID":null},"side":{"target":"C4","id":"side","remoteTrackingBranchID":null}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"},"C3":{"parents":["C1"],"id":"C3"},"C4":{"parents":["C2","C3"],"id":"C4"},"C5":{"parents":["C2"],"id":"C5"}},"HEAD":{"target":"main","id":"HEAD"}}'
);
});
it('makes a tag', function() {
return expectTreeAsync(
'git tag v1',