sync --all avoid unncessary first pass

Sped up seeking to around twice as fast, by avoiding a pass over the
worktree files when preferred content expressions of the local repo and
remotes don't use include=/exclude=.

Thanks to Lukey for identifying the optimisation.

This commit was sponsored by Brock Spratlen on Patreon.
This commit is contained in:
Joey Hess 2020-09-24 15:12:09 -04:00
parent b45b37b088
commit d89984b121
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 86 additions and 12 deletions

View file

@ -57,8 +57,11 @@ type AssumeNotPresent = S.Set UUID
data MatchFiles a = MatchFiles
{ matchAction :: AssumeNotPresent -> MatchInfo -> a Bool
, matchNeedsFileName :: Bool
-- ^ does the matchAction need a filename in order to match?
, matchNeedsFileContent :: Bool
-- ^ does the matchAction need the file content to be present?
-- ^ does the matchAction need the file content to be present in
-- order to succeed?
}
type FileMatcher a = Matcher (MatchFiles a)