def _add_and_modified_in_working_copy(self, ignore_untracked=False):
        inside_work_tree = \
            self._git_cmd('rev-parse --is-inside-work-tree') == 'true'
        if not inside_work_tree:
            raise GitError('Not inside a work tree. Use --rev option.')

        result = []

        prefix_from_repo_root = self._git_cmd('rev-parse --show-prefix')

        # `git status --porcelain` gives output in format "XY PATH",
        # where X and Y refer to staged vs unstaged statuses.
        #
        # However, we don't care about staged vs unstaged. We just want to know
        # which files have been changed or created, so for simplicity we use
        # `git status` to ask "what has possibly changed" and then ask the
        # filesystem which files from that list still exist.
        #
        # Note that we use "." at the end of the status command to limit
        # paths to those under the current working directory.
        if ignore_untracked:
            untracked = "no"
        else:
            untracked = "all"
        cmd = 'status --porcelain --untracked-files={untracked} .'.format(
                untracked=untracked)
        status_output = self._git_cmd(cmd)

        for line in status_output.splitlines():
            path = line[3:]

            # For renames, we just care about new filename
            if ' -> ' in path:
                path = path.split(' -> ', 1)[1]

            path = path[len(prefix_from_repo_root):]

            if os.path.isfile(path):
                result.append(path)

        return result
dataset/ETHPy150Open jenanwise/codequality/codequality/scmhandlers.py/GitHandler._add_and_modified_in_working_copy/original