refactor git-annex branch log filename code into central location
Having one module that knows about all the filenames used on the branch allows working back from an arbitrary filename to enough information about it to implement dropping dead remotes and doing other log file compacting as part of a forget transition.
This commit is contained in:
parent
6147652cc6
commit
62beaa1a86
12 changed files with 136 additions and 74 deletions
|
@ -91,6 +91,12 @@ massReplace vs = go [] vs
|
|||
go (replacement:acc) vs (drop (length val) s)
|
||||
| otherwise = go acc rest s
|
||||
|
||||
{- First item in the list that is not Nothing. -}
|
||||
firstJust :: Eq a => [Maybe a] -> Maybe a
|
||||
firstJust ms = case dropWhile (== Nothing) ms of
|
||||
[] -> Nothing
|
||||
(md:_) -> md
|
||||
|
||||
{- Given two orderings, returns the second if the first is EQ and returns
|
||||
- the first otherwise.
|
||||
-
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue