Skip to content

Commit

Permalink
npm run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tranquochuy645 committed Dec 21, 2024
1 parent 08d7247 commit caff31b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/core/file/gitCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ export const execGitShallowClone = async (
execAsync,
},
) => {
if(branch){
if (branch) {
await deps.execAsync(`git -C ${directory} init`);
await deps.execAsync(`git -C ${directory} remote add origin ${url}`);
await deps.execAsync(`git -C ${directory} fetch --depth 1 origin ${branch}`);
await deps.execAsync(`git -C ${directory} checkout FETCH_HEAD`);
await deps.execAsync(`rm -rf ${directory}/.git 2>/dev/null || rmdir /s /q ${directory}\\.git`)

}else{
await deps.execAsync(`rm -rf ${directory}/.git 2>/dev/null || rmdir /s /q ${directory}\\.git`);

Check warning on line 34 in src/core/file/gitCommand.ts

View check run for this annotation

Codecov / codecov/patch

src/core/file/gitCommand.ts#L30-L34

Added lines #L30 - L34 were not covered by tests
} else {
await deps.execAsync(`git clone --depth 1 ${url} ${directory}`);
}
};
1 change: 0 additions & 1 deletion tests/core/file/gitCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,5 @@ describe('gitCommand', () => {

expect(mockExecAsync).toHaveBeenCalledWith(`git clone --depth 1 ${url} ${directory}`);
});

});
});

0 comments on commit caff31b

Please sign in to comment.