index.js
function readRef(gitFolder, refName) {
	var ref
	try {
		ref = fs.readFileSync(path.join(gitFolder, refName), 'utf8').trim()
		return isSHA1(ref) ? ref : ''
	} catch (e) {
		// Last chance: read from packed-refs
		return readPackedRef(gitFolder, refName)
	}
}
function readRef(gitFolder, refName) {
	var ref
	try {
		ref = fs.readFileSync(path.join(gitFolder, refName), 'utf8').trim()
		return isSHA1(ref) ? ref : ''
	} catch (e) {
		// Last chance: read from packed-refs
		return readPackedRef(gitFolder, refName)
	}
}
function readRef ( gitFolder , refName ) { var ref try { ref = fs . readFileSync ( path . join ( gitFolder , refName ) , 'utf8' ) . trim ( ) return isSHA1 ( ref ) ? ref : '' } catch ( e ) { // Last chance: read from packed-refs return readPackedRef ( gitFolder , refName ) } }
Return the commit name for the given ref name
@param {string} gitFolder
@param {string} refName
@returns {string} - '' if not found
Return the commit name for the given ref name