code: 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);
  }
docs: 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