fix: createBranch gitHelper function

Signed-off-by: RJ Decilos III <decilos_rj@yahoo.com>
This commit is contained in:
RJ Decilos III
2024-10-04 11:11:37 +08:00
committed by RJ Decilos III
parent 6000c69a25
commit d103a48fa3
2 changed files with 4 additions and 3 deletions
@@ -32,6 +32,7 @@ jest.mock('../scm', () => ({
init: jest.fn(),
add: jest.fn(),
checkout: jest.fn(),
branch: jest.fn(),
commit: jest
.fn()
.mockResolvedValue('220f19cc36b551763d157f1b5e4a4b446165dbd6'),
@@ -444,7 +445,7 @@ describe('createBranch', () => {
});
it('create the branch', () => {
expect(mockedGit.checkout).toHaveBeenCalledWith({
expect(mockedGit.branch).toHaveBeenCalledWith({
ref: 'trunk',
dir: '/tmp/repo/dir/',
});
@@ -460,7 +461,7 @@ describe('createBranch', () => {
},
});
expect(mockedGit.checkout).toHaveBeenCalledWith({
expect(mockedGit.branch).toHaveBeenCalledWith({
ref: 'trunk',
dir: '/tmp/repo/dir/',
});
@@ -178,7 +178,7 @@ export async function createBranch(options: {
logger,
});
await git.checkout({ dir, ref });
await git.branch({ dir, ref });
}
/**