import childProcess from 'child_process'
import {promisify} from 'util'

const exec = promisify(childProcess.exec)

export default async function (name) {
  const {stdout} = await exec(`git config --get ${name}`)
  return stdout.trim()
}

import childProcess from 'child_process'
import {promisify} from 'util'

const exec = promisify(childProcess.exec)

export default async function (name) {
  try {
    const {stdout} = await exec(`git config --get ${name}`)
    return stdout.trim()
  } catch {
    return ''
  }
}

Return empty string when a config entry is not defined
fix(getConfig): Return empty string when a config entry is not defined
