pr-check / src / git / areThereUnmergedCommits.ts
areThereUnmergedCommits.ts
Raw
import { getCommitHashesFromGitLog } from "./getCommitHashesFromGitLog";

/**
 * Checks if there are new commits on the current branch that are not on the master branch.
 * @returns A boolean indicating if there are new commits on the current branch.
 */
async function areThereNewCommitsOnThisBranch(): Promise<boolean> {
  const unmergedCommits = await getCommitHashesFromGitLog()
  return unmergedCommits.length > 0
}

export { areThereNewCommitsOnThisBranch }