// isInteresting decides whether commit is interesting according to pathFilter
// based on which files were touched in commits.
549831
func (p *pathFilter) isInteresting(diff []*git.Commit_TreeDiff) (skip bool) {
	isInterestingPath := func(path string) bool {
		switch {
		case path == "":
			return false
		case p.pathExclude != nil && p.pathExclude.MatchString(path):
			return false
		default:
			return p.pathInclude.MatchString(path)
		}
	}

	for _, d := range diff {
		if isInterestingPath(d.GetOldPath()) || isInterestingPath(d.GetNewPath()) {
			return true
		}
	}
	return false
}
961029
func FindFilesInDir(dirPath string, isValidFile func(path string) bool, shouldSkip func(path string, f os.FileInfo) bool) []string {
	files := []string{}
	filepath.Walk(dirPath, func(path string, f os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if shouldSkip(path, f) {
			return filepath.SkipDir
		}
		if !f.IsDir() && isValidFile(path) {
			files = append(files, path)
		}
		return nil
	})
	return files
}
1134647
func (s RouteSpecification) IsSatisfiedBy(itinerary Itinerary) bool {
	return itinerary.Legs != nil &&
		s.Origin == itinerary.InitialDepartureLocation() &&
		s.Destination == itinerary.FinalArrivalLocation()
}
916734
func IsInteractive(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyInteractive).(bool)
	if !ok {
		return true
	}
	return bv
}
1302229
func FilterCommits(commits []*Commit, filterFunc CommitFilterFunc) []*Commit {
	cs := make([]*Commit, 0, len(commits))
	for _, commit := range commits {
		if filterFunc(commit) {
			cs = append(cs, commit)
		}
	}
	return cs
}
1073674
func (l *ListCollaboratorOptions) GetAffiliation() string {
	if l == nil || l.Affiliation == nil {
		return ""
	}
	return *l.Affiliation
}
1047910
func isFollowingForReview(mctx libkb.MetaContext, assertion string) (isFollowing bool, err error) {
	// The 'following' check blocks sending, and is not that important, so impose a timeout.
	var cancel func()
	mctx, cancel = mctx.WithTimeout(time.Second * 5)
	defer cancel()
	err = mctx.G().GetFullSelfer().WithSelf(mctx.Ctx(), func(u *libkb.User) error {
		idTable := u.IDTable()
		if idTable == nil {
			return nil
		}
		targetUsername := libkb.NewNormalizedUsername(assertion)
		for _, track := range idTable.GetTrackList() {
			if trackedUsername, err := track.GetTrackedUsername(); err == nil {
				if trackedUsername.Eq(targetUsername) {
					isFollowing = true
					return nil
				}
			}
		}
		return nil
	})
	return isFollowing, err
}
30288
func isInUse(l string, logs []string) bool {
	// All temporary files are not in use.
	if strings.HasSuffix(l, tmpSuffix) {
		return false
	}
	// All compresed logs are in use.
	if strings.HasSuffix(l, compressSuffix) {
		return true
	}
	// Files has already been compressed are not in use.
	for _, another := range logs {
		if l+compressSuffix == another {
			return false
		}
	}
	return true
}
612854
func IsDirReal(path string) (bool, error) {
	fileInfo, err := os.Lstat(path)
	if err != nil {
		return false, err
	}
	// Check if symlink
	if fileInfo.Mode()&os.ModeSymlink != 0 {
		return false, fmt.Errorf("Path is a symlink")
	}
	if !fileInfo.Mode().IsDir() {
		return false, fmt.Errorf("Path is not a directory")
	}
	return true, nil
}
348099
func isIgnoredFile(filename string) bool {
	matchFile := path.Base(filename)

	// OS specific ignore list.
	for _, ignoredFile := range ignoreFiles[runtime.GOOS] {
		matched, err := filepath.Match(ignoredFile, matchFile)
		if err != nil {
			panic(err)
		}
		if matched {
			return true
		}
	}

	// Default ignore list for all OSes.
	for _, ignoredFile := range ignoreFiles["default"] {
		matched, err := filepath.Match(ignoredFile, matchFile)
		if err != nil {
			panic(err)
		}
		if matched {
			return true
		}
	}

	return false
}
938274
func (k Key) IsAncestorOf(other Key) bool {
	if other.string == k.string {
		return false
	}
	return strings.HasPrefix(other.string, k.string)
}
957980
func isSiteRoot(p string) bool {
	fi, err := os.Stat(filepath.Join(p, fs.SiteServiceDir))
	return err == nil && fi.IsDir()
}
146728
func isInternal(n *node) bool {
	if n == nil {
		return false
	}
	return n.entry == nil
}
937433
func hasTrailingPathSeparator(path string) bool {
	return len(path) > 0 && os.IsPathSeparator(path[len(path)-1])
}
491481
func (g *Git) IsInitialized() bool {
	return fsutil.IsFile(filepath.Join(g.path, ".git", "config"))
}
1247577
func (s *Selection) IsSelection(sel *Selection) bool {
	return s.FilterSelection(sel).Length() > 0
}
327718
func IsIntersecting(rect1 engo.AABB, rect2 engo.AABB) bool {
	if rect1.Max.X > rect2.Min.X && rect1.Min.X < rect2.Max.X && rect1.Max.Y > rect2.Min.Y && rect1.Min.Y < rect2.Max.Y {
		return true
	}

	return false
}