def GetChange(self, upstream_branch, author):
    if (not self.GitSanityChecks(upstream_branch)):
        DieWithError('\nGit sanity check failure')
    root = settings.GetRelativeRoot()
    if (not root):
        root = '.'
    absroot = os.path.abspath(root)
    name = RunGitWithCode(['rev-parse', 'HEAD'])[1].strip()
    try:
        files = scm.GIT.CaptureStatus([root], '.', upstream_branch)
    except subprocess2.CalledProcessError:
        DieWithError(("\nFailed to diff against upstream branch %s\n\nThis branch probably doesn't exist anymore. To reset the\ntracking branch, please run\n    git branch --set-upstream %s trunk\nreplacing trunk with origin/master or the relevant branch" % (upstream_branch, self.GetBranch())))
    issue = self.GetIssue()
    patchset = self.GetPatchset()
    if issue:
        description = self.GetDescription()
    else:
        args = ['log', '--pretty=format:%s%n%n%b', ('%s...' % upstream_branch)]
        description = RunGitWithCode(args)[1].strip()
    if (not author):
        author = (RunGit(['config', 'user.email']).strip() or None)
    return presubmit_support.GitChange(name, description, absroot, files, issue, patchset, author, upstream=upstream_branch)
def GetChange(self, upstream_branch, author):
    if (not self.GitSanityChecks(upstream_branch)):
        DieWithError('\nGit sanity check failure')
    root = settings.GetRelativeRoot()
    if (not root):
        root = '.'
    absroot = os.path.abspath(root)
    name = RunGitWithCode(['rev-parse', 'HEAD'])[1].strip()
    try:
        files = scm.GIT.CaptureStatus([root], '.', upstream_branch)
    except subprocess2.CalledProcessError:
        DieWithError(("\nFailed to diff against upstream branch %s\n\nThis branch probably doesn't exist anymore. To reset the\ntracking branch, please run\n    git branch --set-upstream %s trunk\nreplacing trunk with origin/master or the relevant branch" % (upstream_branch, self.GetBranch())))
    issue = self.GetIssue()
    patchset = self.GetPatchset()
    if issue:
        description = self.GetDescription()
    else:
        args = ['log', '--pretty=format:%s%n%n%b', ('%s...' % upstream_branch)]
        description = RunGitWithCode(args)[1].strip()
    if (not author):
        author = (RunGit(['config', 'user.email']).strip() or None)
    return presubmit_support.GitChange(name, description, absroot, files, issue, patchset, author, upstream=upstream_branch)