From 8ca97e43f3543b11b174e5b340903d1f48dee46a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Feb 2016 15:09:25 -0400 Subject: simplify; no need for separate filter reversal function --- doc/design/adjusted_branches.mdwn | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'doc') diff --git a/doc/design/adjusted_branches.mdwn b/doc/design/adjusted_branches.mdwn index 4cbed8701..646b86b72 100644 --- a/doc/design/adjusted_branches.mdwn +++ b/doc/design/adjusted_branches.mdwn @@ -193,29 +193,24 @@ like this, at its most simple: data FileInfo = FileInfo { originalBranchFile :: FileStatus - , worktreeFile :: Maybe FileStatus , isContentPresent :: Bool } data FileStatus = IsAnnexSymlink | IsAnnexPointer deriving (Eq) - applyFilter :: Filter -> FilePath -> FileInfo -> FilterAction - applyFilter UnlockFilter f fi - | worktreeFile fi == Just IsAnnexSymlink = UnlockFile f - applyFilter HideMissingFilter f fi + filterAction :: Filter -> FilePath -> FileInfo -> FilterAction + filterAction UnlockFilter f fi + | originalBranchFile fi == Just IsAnnexSymlink = UnlockFile f + filterAction HideMissingFilter f fi | not (isContentPresent fi) = HideFile f - applyFilter UnlockHideMissingFilter f fi + filterAction UnlockHideMissingFilter f fi | not (isContentPresent fi) = HideFile f - | otherwise = applyFilter UnlockFilter f fi - applyFilter _ f _ = UnchangedFile f + | otherwise = filterAction UnlockFilter f fi + filterAction _ f _ = UnchangedFile f applyFilterAction :: FilePath -> FilterAction -> Annex Bool - -- Look at the current state of file and get the FilterAction that - -- would have led to this state. - reverseFilter :: Filter -> FilePath -> FileInfo -> FilterAction - -- Generate a version of the commit made on the filter branch -- with the filtering of modified files reversed. unfilteredCommit :: Filter -> Git.Commit -> Git.Commit -- cgit v1.2.3