for whatever reason nils/false weird things creep
 into the files_of_interest. We have to make sure to only
 try to look up diffs for actual filepaths (strings)
325109
def diffs_of_interest
      files_of_interest.map do |file|
        diff = EmptyDiff.new
        begin
          diff = git.diff_for_file(file)
        rescue NoMethodError
          log_unable_to_find_diff(file.inspect)
        end
        diff
      end
    end
410430
private File fileExists(final String path, final long checksum) throws FrameworkException {

		final PropertyKey<Long> checksumKey = StructrApp.key(File.class, "checksum");
		final PropertyKey<String> pathKey   = StructrApp.key(File.class, "path");

		return app.nodeQuery(File.class).and(pathKey, path).and(checksumKey, checksum).getFirst();
	}
1057891
function checkForChangedFiles(dir) {
    var fileList = fs.readdirSync(dir);
    for (var i=0;i<fileList.length;i++) {
        if (!isWatching(fileList[i])) {
            continue;
        }
        if (!fs.existsSync(dir+fileList[i])) { continue; }
        var stats;
        try {
            stats = fs.statSync(dir + fileList[i]);
        }
        catch (err) {
            // this means the file disappeared between the exists and when we tried to stat it...
            continue;
        }
        if (timeStamps[dir+fileList[i]] === undefined || timeStamps[dir+fileList[i]] !== stats.mtime.getTime()) {
            //console.log("Found 1: ", dir+fileList[i], timeStamps[dir+fileList[i]], stats.mtime.getTime());

            timeStamps[dir+fileList[i]] = stats.mtime.getTime();
            return dir+fileList[i];
        }
    }
    return null;
}
1221221
function () {
        function filter(file) {
            return _subtreeFilter(file, null) && _isReadableText(file.fullPath);
        }
        FindUtils.setInstantSearchDisabled(true);

        //we always listen for filesytem changes.
        _addListeners();

        if (!PreferencesManager.get("findInFiles.nodeSearch")) {
            return;
        }
        ProjectManager.getAllFiles(filter, true, true)
            .done(function (fileListResult) {
                var files = fileListResult,
                    filter = FileFilters.getActiveFilter();
                if (filter && filter.patterns.length > 0) {
                    files = FileFilters.filterFileList(FileFilters.compile(filter.patterns), files);
                }
                files = files.filter(function (entry) {
                    return entry.isFile && _isReadableText(entry.fullPath);
                }).map(function (entry) {
                    return entry.fullPath;
                });
                FindUtils.notifyIndexingStarted();
                searchDomain.exec("initCache", files);
            });
        _searchScopeChanged();
    }
136959
def dirty?(path = Dir.pwd)
      g = MiniGit.new(path)
      a = g.capturing.diff :shortstat => true
      #ap a
      !a.empty?
    end
192750
def _find_glob_matches(in_files, metadata):
    
    reg_files = copy.deepcopy(in_files)
    glob_files = []
    for glob_search in [x for x in metadata.keys() if "*" in x]:
        cur = []
        for fname in in_files:
            if fnmatch.fnmatch(fname, "*/%s" % glob_search):
                cur.append(fname)
                reg_files.remove(fname)
        assert cur, "Did not find file matches for %s" % glob_search
        glob_files.append(cur)
    return reg_files, glob_files
857075
function _removeDeletedFileFromMRU(e, fullPath) {
        var index,
            compare = function (record) {
                return (record.file.fullPath === fullPath);
            };

        // find and remove all instances
        do {
            index = _.findIndex(_mruList, compare);
            if (index !== -1) {
                _mruList.splice(index, 1);
            }
        } while (index !== -1);
    }
1240572
function colorPaletteDataExists() {
  try {
    return fs.statSync(options.fallback.jsonPath).isFile();
  } catch (e) {
    // Check exception. If ENOENT - no such file or directory ok, file doesn't exist.
    // Otherwise something else went wrong, we don't have rights to access the file, ...
    if (e.code !== 'ENOENT') {
      throw e;
    }

    return false;
  }
}
719294
public static void removeSimilaritiesAndSaveFiles(List<String> filepathes,
            Log logging, Boolean isWindows) throws IOException {
        List<File> files = new LinkedList<File>();
        for (String path : filepathes) {
            files.add(new File(path));
        }
        FileComparer fcomparer;
        for (int i = 0; i < files.size(); i++) {
            for (int y = i + 1; y < files.size(); y++) {
                fcomparer = new FileComparer(files.get(i), files.get(y),
                    logging, isWindows);
                fcomparer.removeSimilarClassesFromFile1();
            }
        }
    }
878661
private static void checkSrcPath(Configuration conf, List<Path> srcPaths
      ) throws IOException {
    List<IOException> rslt = new ArrayList<IOException>();
    List<Path> unglobbed = new LinkedList<Path>();
    for (Path p : srcPaths) {
      FileSystem fs = p.getFileSystem(conf);
      FileStatus[] inputs = fs.globStatus(p);

      if(inputs != null && inputs.length > 0) {
        for (FileStatus onePath: inputs) {
          unglobbed.add(onePath.getPath());
        }
      } else {
        rslt.add(new IOException("Input source " + p + " does not exist."));
      }
    }
    if (!rslt.isEmpty()) {
      throw new InvalidInputException(rslt);
    }
    srcPaths.clear();
    srcPaths.addAll(unglobbed);
  }
626985
def remove_files_in_folder(base_path)
      existing_files = Dir.glob(File.join(base_path, '**', '*'), File::FNM_DOTMATCH).map {|path| File.expand_path(path)}.uniq.reverse # expand_path just to normalize foo/. -> foo
      existing_files.delete(base_path) # Don't remove the base
      # Fuck FileUtils, it is a confusing pile of fail for remove*/rm*
      existing_files.each do |path|
        if File.file?(path)
          File.unlink(path)
        elsif File.directory?(path)
          Dir.unlink(path)
        else
          # Because paranoia
          raise Error.new("Unknown type of file at '#{path}', possible symlink deletion attack")
        end
      end
    end
57715
function(files) {
				var l = files.length,
					inSearch = fm.searchStatus.state > 1,
					curCmd = fm.getCommand(fm.currentReqCmd) || {},
					hash, n, ndx, found;

				// removed cwd
				if (!fm.cwd().hash && !curCmd.noChangeDirOnRemovedCwd) {
					$.each(cwdParents.reverse(), function(i, h) {
						if (fm.file(h)) {
							found = true;
							fm.one(fm.currentReqCmd + 'done', function() {
								!fm.cwd().hash && fm.exec('open', h);
							});
							return false;
						}
					});
					// fallback to fm.roots[0]
					!found && !fm.cwd().hash && fm.exec('open', fm.roots[Object.keys(fm.roots)[0]]);
					return;
				}
				
				while (l--) {
					hash = files[l];
					if ((n = $('#'+fm.cwdHash2Id(hash))).length) {
						try {
							n.remove();
							--bufferExt.renderd;
						} catch(e) {
							fm.debug('error', e);
						}
					} else if ((ndx = index(hash)) !== -1) {
						buffer.splice(ndx, 1);
					}
					selectedFiles[hash] && delete selectedFiles[hash];
					if (inSearch) {
						if ((ndx = $.inArray(hash, cwdHashes)) !== -1) {
							cwdHashes.splice(ndx, 1);
						}
					}
				}
				
				inSearch && fm.trigger('cwdhasheschange', cwdHashes);
				
				if (list) {
					setColwidth();
					fixTableHeader({fitWidth: ! colWidth});
				}
			}
1127241
boolean checkForChanges()
    {
        // initialize with last checked files
        final Map<File, byte[]> presents = new HashMap<>(fingerprints);
        boolean modified = traverseDirectory(location, new IFileVisitor()
        {
            @Override
            public boolean visitFile(File file)
            {
                return modified(presents.remove(file), file);
            }

            @Override
            public boolean visitDir(File dir)
            {
                return modified(presents.remove(dir), dir);
            }
        });
        // if some files remain, that means they have been deleted since last scan
        return modified || !presents.isEmpty();
    }
1120709
def _is_dirty(dir_path):
    """"""
    try:
        subprocess.check_call(["git", "diff", "--quiet"], cwd=dir_path)
        return False
    except subprocess.CalledProcessError:
        return True
1159908
def check_case_sensitivity (self):
        
        if os.name != 'nt':
            return
        path = self.get_os_filename()
        realpath = get_nt_filename(path)
        if path != realpath:
            self.add_warning(_("The URL path %(path)r is not the same as the "
                            "system path %(realpath)r. You should always use "
                            "the system path in URLs.") % \
                            {"path": path, "realpath": realpath},
                               tag=WARN_FILE_SYSTEM_PATH)
1291682
function normalizePaths(opts) {
  for (var srcKey in opts.src) {
    if (!path.isAbsolute(opts.src[srcKey].glob)) {
      opts.src[srcKey].glob = path.resolve(opts.src[srcKey].glob);
    }
    if (!path.isAbsolute(opts.src[srcKey].basedir)) {
      opts.src[srcKey].basedir = path.resolve(opts.src[srcKey].basedir);
    }
  }
}
1102454
function errorDiff(actual, expected) {
  return diff
    .diffWordsWithSpace(actual, expected)
    .map(function(str) {
      if (str.added) {
        return colorLines('diff added', str.value);
      }
      if (str.removed) {
        return colorLines('diff removed', str.value);
      }
      return str.value;
    })
    .join('');
}