add git bundle interface
Sponsored-by: mycroft on Patreon
This commit is contained in:
parent
8d58a23548
commit
e1447dc2e2
2 changed files with 26 additions and 0 deletions
25
Git/Bundle.hs
Normal file
25
Git/Bundle.hs
Normal file
|
@ -0,0 +1,25 @@
|
|||
{- git bundles
|
||||
-
|
||||
- Copyright 2024 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
||||
module Git.Bundle where
|
||||
|
||||
import Common
|
||||
import Git
|
||||
import Git.Command
|
||||
|
||||
import Data.Char (ord)
|
||||
import qualified Data.ByteString.Char8 as S8
|
||||
|
||||
listHeads :: FilePath -> Repo -> IO [(Sha, Ref)]
|
||||
listHeads bundle repo = map gen . S8.lines <$>
|
||||
pipeReadStrict [Param "bundle", Param "list-heads", File bundle] repo
|
||||
where
|
||||
gen l = let (s, r) = separate' (== fromIntegral (ord ' ')) l
|
||||
in (Ref s, Ref r)
|
||||
|
||||
unbundle :: FilePath -> Repo -> IO ()
|
||||
unbundle bundle = runQuiet [Param "bundle", Param "unbundle", File bundle]
|
|
@ -760,6 +760,7 @@ Executable git-annex
|
|||
Git.AutoCorrect
|
||||
Git.Branch
|
||||
Git.BuildVersion
|
||||
Git.Bundle
|
||||
Git.CatFile
|
||||
Git.CheckAttr
|
||||
Git.CheckIgnore
|
||||
|
|
Loading…
Reference in a new issue