def create_git_context(build):
    """
    Create the git_info object for git source builds
    """
    git_info = {}
    github_info = build.get('github_info', {})
    if github_info:
        ghrepo = github_info['repository']
        ghowner = ghrepo['owner'].get('name', ghrepo['owner'].get('login'))
        git_info['full_name'] = '%s/%s' % (ghowner, ghrepo['name'])
        git_info['branch'] = github_info['ref'].split('/', 2)[-1]
        git_info['commit'] = github_info['after']
    return git_info
