Skip to content

Commit ab8cf31

Browse files
committed
chore: optimize simpleGit call
1 parent 028436d commit ab8cf31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/proxy/processors/push-action/checkEmptyBranch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import simpleGit from 'simple-git';
33
import { EMPTY_COMMIT_HASH } from '../constants';
44

55
const isEmptyBranch = async (action: Action) => {
6-
const git = simpleGit(`${action.proxyGitPath}/${action.repoName}`);
7-
86
if (action.commitFrom === EMPTY_COMMIT_HASH) {
97
try {
8+
const git = simpleGit(`${action.proxyGitPath}/${action.repoName}`);
9+
1010
const type = await git.raw(['cat-file', '-t', action.commitTo || '']);
1111
return type.trim() === 'commit';
1212
} catch (err) {

0 commit comments

Comments
 (0)