def _get_local_rev_and_branch(target, user):
    log.info('Checking local revision for {0}'.format(target))
    try:
        local_rev = __salt__['git.revision'](target,
                                             user=user,
                                             ignore_retcode=True)
    except CommandExecutionError:
        log.info('No local revision for {0}'.format(target))
        local_rev = None

    log.info('Checking local branch for {0}'.format(target))
    try:
        local_branch = __salt__['git.current_branch'](target,
                                                      user=user,
                                                      ignore_retcode=True)
    except CommandExecutionError:
        log.info('No local branch for {0}'.format(target))
        local_branch = None

    return local_rev, local_branch
Return the local revision for before/after comparisons
dataset/ETHPy150Open saltstack/salt/salt/states/git.py/_get_local_rev_and_branch