def RunGitWithCode(args, suppress_stderr=False):
    'Returns return code and stdout.'
    try:
        if suppress_stderr:
            stderr = subprocess2.VOID
        else:
            stderr = sys.stderr
        (out, code) = subprocess2.communicate((['git'] + args), env=GetNoGitPagerEnv(), stdout=subprocess2.PIPE, stderr=stderr)
        return (code, out[0])
    except ValueError:
        return (1, '')
Returns return code and stdout.
def RunGitWithCode(args, suppress_stderr=False):
    
    try:
        if suppress_stderr:
            stderr = subprocess2.VOID
        else:
            stderr = sys.stderr
        (out, code) = subprocess2.communicate((['git'] + args), env=GetNoGitPagerEnv(), stdout=subprocess2.PIPE, stderr=stderr)
        return (code, out[0])
    except ValueError:
        return (1, )