diff options
author | Joey Hess <joey@kitenet.net> | 2011-06-22 23:24:14 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-06-22 23:24:14 -0400 |
commit | aad73c5721490a5679820ab9c16a8b462fa0e0f2 (patch) | |
tree | 3156a0debf9a707f4e928811b0aa151d2c4d0e13 /Branch.hs | |
parent | 68783fd5e0e23ce698f2c2c2e2bd28c54cadf9c5 (diff) |
rewrite loggedkeys to use git-annex branch
That sucking sound is a whole page of code vanishing to be replaced with
return . catMaybes . map (logFileKey . takeFileName) =<< Branch.files
What can I say, git is my database, and haskell my copilot.
Diffstat (limited to 'Branch.hs')
-rw-r--r-- | Branch.hs | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -11,7 +11,7 @@ module Branch ( get, change, commit, - shortref + files ) where import Control.Monad (unless, when, liftM) @@ -222,3 +222,10 @@ cmdOutput cmd params = do let rv = seq retval retval _ <- getProcessStatus True False pid return rv + +{- Lists all files on the branch. -} +files :: Annex [FilePath] +files = withIndexUpdate $ do + g <- Annex.gitRepo + liftIO $ Git.pipeNullSplit g + [Params "ls-tree --name-only -r -z", Param fullname] |