Return a set of all the files under git control
969893
def all_files(self):
        """"""
        return set([entry.decode() for entry, _ in self.git.open_index().items()])
831097
def get_git_refs(repopath):
    
    tags = []
    branches = []
    branch = ''
    files_modifed = []

    if os.path.isfile(repopath):
        repopath = os.path.dirname(repopath)

    try:

        git = programs.find_program('git')

        # Files modified
        out, err = programs.run_program(
            git, ['status', '-s'],
            cwd=repopath,
        ).communicate()

        if PY3:
            out = out.decode(sys.getdefaultencoding())
        files_modifed = [line.strip() for line in out.split('\n') if line]

        # Tags
        out, err = programs.run_program(
            git, ['tag'],
            cwd=repopath,
        ).communicate()

        if PY3:
            out = out.decode(sys.getdefaultencoding())
        tags = [line.strip() for line in out.split('\n') if line]

        # Branches
        out, err = programs.run_program(
            git, ['branch', '-a'],
            cwd=repopath,
        ).communicate()

        if PY3:
            out = out.decode(sys.getdefaultencoding())

        lines = [line.strip() for line in out.split('\n') if line]
        for line in lines:
            if line.startswith('*'):
                line = line.replace('*', '').strip()
                branch = line

            branches.append(line)

    except (subprocess.CalledProcessError, AttributeError, OSError):
        pass

    return branches + tags, branch, files_modifed
947253
def full_file_list(scan_path):
    
    file_list = []
    path = os.path.abspath(scan_path)
    for root, dirs, files in os.walk(path):
        if len(files) != 0 and not '.svn' in root and not '.git' in root:
            for f in files:
                file_list.append(os.path.join(root, f))
    return file_list
495592
def get_used_files():
    """"""
    import psutil
    loop_over_scanpy_processes = (proc for proc in psutil.process_iter()
                                  if proc.name() == 'scanpy')
    filenames = []
    for proc in loop_over_scanpy_processes:
        try:
            flist = proc.open_files()
            for nt in flist:
                filenames.append(nt.path)
        # This catches a race condition where a process ends
        # before we can examine its files
        except psutil.NoSuchProcess as err:
            pass
    return set(filenames)
634001
def files(self):
    """"""
    all_files = set()
    for label in self.filesets:
      all_files.update(self.filesets[label])
    return all_files
483914
def collect_modules(self):
        """"""
        for path, dirlist, filelist in os.walk(self.root):
            for name in fnmatch.filter(filelist, self.filter):
                if self.is_git_file(path, name):
                    yield (os.path.join(path, name), [])
59573
def fetch(self, remote=None, refspec=None, verbose=False, tags=True):
        """"""
        return git_fetch(self.repo_dir, remote=remote,
                         refspec=refspec, verbose=verbose, tags=tags)
732824
function getStagedFiles(callback) {

    const options = [ 'diff', '--cached', '--name-only', '--diff-filter=ACM' ]

    execFile('git', options, (err, stdout) => {

        if (err) return callback(err)

        const stagedFiles = stdout
            .split('\n')
            .filter(filename => filename.match(/.js$/))

        callback(null, stagedFiles)

    })

}
366823
def get_files(commit_only=True, copy_dest=None):
    ""
    if commit_only:
        real_files = bash(
            "git diff --cached --name-status | "
            "grep -v -E '^D' | "
            "awk '{ print ( $(NF) ) }' "
        ).value().strip()
    else:
        real_files = bash(
            "git ls-tree --name-only --full-tree -r HEAD"
        ).value().strip()

    if real_files:
        return create_fake_copies(real_files.split('\n'), copy_dest)
    return []
115344
def reset_deleted_files(self):
        

        yield from self.ensure_lock()
        deleted_files = subprocess.check_output([
            'git', 'ls-files', '--deleted'
        ], cwd=self.repo_dir).decode().strip().split('\n')

        for filename in deleted_files:
            if filename:  # Filter out empty lines
                yield from execute_cmd(['git', 'checkout', '--', filename], cwd=self.repo_dir)
249117
private function getFiles()
    {
        $process = new Process('git diff --cached --name-status --diff-filter=ACMR');
        $process->run();

        if ($process->isSuccessful()) {
            return array_filter(explode("\n", $process->getOutput()));
        }

        return [];
    }
1011558
def load(self):
        """"""
        if not git:
            raise EnvironmentError(MISSING_GIT_ERROR)

        if os.path.exists(self.path):
            if not config.CACHE_DISABLE:
                return
            shutil.rmtree(self.path, ignore_errors=True)

        with files.remove_on_exception(self.path):
            url = self.GIT_URL.format(**vars(self))
            repo = git.Repo.clone_from(
                url=url, to_path=self.path, b=self.branch)
            if self.commit:
                repo.head.reset(self.commit, index=True, working_tree=True)
104334
def find_notignored_git_files(self, context, silent_build):
        
        def git(args, error_message, cwd=context.parent_dir, **error_kwargs):
            output, status = command_output("git {0}".format(args), cwd=cwd)
            if status != 0:
                error_kwargs['output'] = output
                error_kwargs['directory'] = context.parent_dir
                raise HarpoonError(error_message, **error_kwargs)
            return output

        changed_files = git("diff --name-only", "Failed to determine what files have changed")
        untracked_files = git("ls-files --others --exclude-standard", "Failed to find untracked files")

        valid = set()
        under_source_control = git("ls-files --exclude-standard", "Failed to find all the files under source control")
        git_submodules = [regexes["whitespace"].split(line.strip())[1] for line in git("submodule status", "Failed to find submodules", cwd=context.git_root)]
        git_submodules = [os.path.normpath(os.path.relpath(os.path.abspath(p), os.path.abspath(os.path.relpath(context.parent_dir, context.git_root)))) for p in git_submodules]

        valid = under_source_control + untracked_files

        for filename in list(valid):
            matched = False
            if context.exclude:
                for excluder in context.exclude:
                    if fnmatch.fnmatch(filename, excluder):
                        matched = True
                        break

            if matched:
                continue

            location = os.path.join(context.parent_dir, filename)
            if os.path.islink(location) and os.path.isdir(location):
                actual_path = os.path.abspath(os.path.realpath(location))
                parent_dir = os.path.abspath(os.path.realpath(context.parent_dir))
                include_from = os.path.relpath(actual_path, parent_dir)

                to_include = git("ls-files --exclude-standard -- {0}".format(include_from), "Failed to find files under a symlink")
                for found in to_include:
                    valid += [os.path.join(filename, os.path.relpath(found, include_from))]
            elif os.path.isdir(location) and filename in git_submodules:
                to_include = git("ls-files --exclude-standard", "Failed to find files in a submodule", cwd=location)
                valid = [v for v in valid if v != filename]
                for found in to_include:
                    valid.append(os.path.join(filename, found))

        return set(self.convert_nonascii(valid))
1001185
function getFiles(paths) {
  var result = fileUtil.getAllFiles(paths);

  var files = result.map(function (item) {
    return item.relativePath;
    // return path.join(item.basePath, item.relativePath);
  });

  return files;
}
55138
def get_changed_files(self) -> List[str]:
        
        out = shell_tools.output_of(
            'git',
            'diff',
            '--name-only',
            self.compare_commit_id,
            self.actual_commit_id,
            '--',
            cwd=self.destination_directory)
        return [e for e in out.split('\n') if e.strip()]
761704
def items(self, section_name):
        """"""
        return [(k, v) for k, v in super(GitConfigParser, self).items(section_name) if k != '__name__']
1041716
def fetch_all(options = {})
      options = { :prune => false }.merge(options)
      git_args = ['--all']
      git_args << '--prune' if options[:prune]
      fetch(git_args)
      fetch('--tags')  # need a separate call for tags or else you don't get all the tags
      true
    end