diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-02-09 15:09:25 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-02-09 15:09:25 -0400 |
commit | 8ca97e43f3543b11b174e5b340903d1f48dee46a (patch) | |
tree | 452855c8d8e78fe29ede0fcfda4216da733d6527 /doc | |
parent | 8e98569114019a089f7692c615ef531810551c46 (diff) |
simplify; no need for separate filter reversal function
Diffstat (limited to 'doc')
-rw-r--r-- | doc/design/adjusted_branches.mdwn | 19 |
1 files changed, 7 insertions, 12 deletions
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 |