lib/git.js
async function isCheckedOut(dir, ref) {
  let oidCurrent;
  return git.resolveRef({ dir, ref: 'HEAD' })
    .then((oid) => {
      oidCurrent = oid;
      return git.resolveRef({ dir, ref });
    })
    .then(oid => oidCurrent === oid)
    .catch(() => false);
}
async function isCheckedOut(dir, ref) {
  let oidCurrent;
  return git.resolveRef({ dir, ref: 'HEAD' })
    .then((oid) => {
      oidCurrent = oid;
      return git.resolveRef({ dir, ref });
    })
    .then(oid => oidCurrent === oid)
    .catch(() => false);
}
async function isCheckedOut ( dir , ref ) { let oidCurrent ; return git . resolveRef ( { dir , ref : 'HEAD' } ) . then ( ( oid ) => { oidCurrent = oid ; return git . resolveRef ( { dir , ref } ) ; } ) . then ( oid => oidCurrent === oid ) . catch ( ( ) => false ) ; }
Determines whether the specified reference is currently checked out in the working dir.

@param {string} dir git repo path
@param {string} ref reference (branch or tag)
@returns {Promise<boolean>} `true` if the specified reference is checked out
Determines whether the specified reference is currently checked out in the working dir .