Skip to content

Commit

Permalink
Fix logging inside ensureRefAvailable()
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Dorner committed Apr 12, 2021
1 parent 0b18612 commit f1c461f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
8 changes: 1 addition & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4001,13 +4001,7 @@ function isGitSha(ref) {
}
exports.isGitSha = isGitSha;
async function hasCommit(ref) {
core.startGroup(`Checking if commit for ${ref} is locally available`);
try {
return (await exec_1.default('git', ['cat-file', '-e', `${ref}^{commit}`], { ignoreReturnCode: true })).code === 0;
}
finally {
core.endGroup();
}
return (await exec_1.default('git', ['cat-file', '-e', `${ref}^{commit}`], { ignoreReturnCode: true })).code === 0;
}
async function getCommitCount() {
const output = (await exec_1.default('git', ['rev-list', '--count', '--all'])).stdout;
Expand Down
7 changes: 1 addition & 6 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,7 @@ export function isGitSha(ref: string): boolean {
}

async function hasCommit(ref: string): Promise<boolean> {
core.startGroup(`Checking if commit for ${ref} is locally available`)
try {
return (await exec('git', ['cat-file', '-e', `${ref}^{commit}`], {ignoreReturnCode: true})).code === 0
} finally {
core.endGroup()
}
return (await exec('git', ['cat-file', '-e', `${ref}^{commit}`], {ignoreReturnCode: true})).code === 0
}

async function getCommitCount(): Promise<number> {
Expand Down

0 comments on commit f1c461f

Please sign in to comment.