class ChefCLI::CookbookProfiler::Git
def revision
def revision git!("rev-parse HEAD").stdout.strip rescue Mixlib::ShellOut::ShellCommandFailed => e # We may have an "unborn" branch, i.e. one with no commits. if unborn_branch_ref nil else # if we got here, but verify_ref_cmd didn't error, we don't know why # the original git command failed, so re-raise. raise e end end