def git_list_refs(repo_dir):
    """List references available in the local repo with commit ids.

    This is similar to ls-remote, but shows the *local* refs.

    Return format:

    .. code-block:: python

        {<ref1>: <commit_hash1>,
         <ref2>: <commit_hash2>,
         ...,
         <refN>: <commit_hashN>,
        }
    """
    command = ['git', 'show-ref', '--dereference', '--head']
    raw = execute_git_command(command, repo_dir=repo_dir).splitlines()
    output = [l.strip() for l in raw if l.strip()]
    return {ref: commit_hash for commit_hash, ref in
            [l.split(None, 1) for l in output]}