':type args: CommonConfig
:type git: Git'

def __init__(self, args, git):

    self.args = args
    self.current_branch = git.get_branch()
    if self.is_official_branch(self.current_branch):
        raise InvalidBranch(branch=self.current_branch, reason='Current    branch    is    not    a    feature    branch.')
    self.fork_branch = None
    self.fork_point = None
    self.local_branches = sorted(git.get_branches())
    self.official_branches = sorted([b for b in self.local_branches if self.is_official_branch(b)])
    for self.fork_branch in self.official_branches:
        try:
            self.fork_point = git.get_branch_fork_point(self.fork_branch)
            break
        except SubprocessError:
            pass
    if (self.fork_point is None):
        raise ApplicationError('Unable    to    auto-detect    fork    branch    and    fork    point.')
    self.tracked = sorted(git.get_file_names(['--cached']))
    self.untracked = sorted(git.get_file_names(['--others', '--exclude-standard']))
    self.committed = sorted(git.get_diff_names([self.fork_point, 'HEAD']))
    self.staged = sorted(git.get_diff_names(['--cached']))
    self.unstaged = sorted(git.get_diff_names([]))
    self.diff = git.get_diff([self.fork_point])
