import { rejects } from 'assert'
import { getLastCommit } from 'git-last-commit'

export async function getGitCommit(path: string) {
  return new Promise((res, _rej) => {
    getLastCommit(
      (err, commit) => {
        if (err) return res(null)
        return res(commit)
      },
      { dst: path }
    )
  })
}
