git.read_head

git

read_head(git_dir) -> head

Read HEAD of a repository

Returns { type = "branch", name = short_name, ref = full_ref } for a symbolic HEAD, or { type = "detached", sha = sha } for a detached one.