packages feed

gitlib 0.6.5 → 0.7.0

raw patch · 3 files changed

+19/−10 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Git.Repository: repoBeforeReadRef :: Repository -> [Repository -> Text -> IO ()]
- Data.Git.Repository: Repository :: FilePath -> [Reference -> IO ()] -> ForeignPtr C'git_repository -> Repository
+ Data.Git.Repository: Repository :: FilePath -> [Repository -> Text -> IO ()] -> [Repository -> Reference -> IO ()] -> ForeignPtr C'git_repository -> Repository
- Data.Git.Repository: repoOnWriteRef :: Repository -> [Reference -> IO ()]
+ Data.Git.Repository: repoOnWriteRef :: Repository -> [Repository -> Reference -> IO ()]

Files

Data/Git/Internal.hs view
@@ -119,9 +119,15 @@   getObject (IdRef _)  = Nothing   getObject (ObjRef x) = Just x -data Repository = Repository { repoPath       :: FilePath-                             , repoOnWriteRef :: [Reference -> IO ()]-                             , repoObj        :: ForeignPtr C'git_repository }+data Repository = Repository+    { repoPath :: FilePath+    -- jww (2013-01-21): These two callbacks are a temporary workaround until+    -- libgit2 supports full virtualization of repositories.  See:+    -- https://github.com/libgit2/libgit2/issues/1213+    , repoBeforeReadRef :: [Repository -> Text -> IO ()]+    , repoOnWriteRef    :: [Repository -> Reference -> IO ()]+    , repoObj           :: ForeignPtr C'git_repository+    }  instance Eq Repository where   x == y = repoPath x == repoPath y && repoObj x == repoObj y@@ -184,10 +190,11 @@         when (r < 0) $ doesNotExist p         ptr' <- peek ptr         fptr <- newForeignPtr p'git_repository_free ptr'-        return Repository { repoPath       = path-                          , repoOnWriteRef = []-                          , repoObj        = fptr }-+        return Repository { repoPath          = path+                          , repoBeforeReadRef = []+                          , repoOnWriteRef    = []+                          , repoObj           = fptr+                          }   where doesNotExist = throwIO . RepositoryNotExist . toString  withObject :: (Updatable a, Updatable b) => ObjRef a -> b -> (a -> IO c) -> IO c
Data/Git/Reference.hs view
@@ -43,6 +43,7 @@  lookupRef :: Repository -> Text -> IO (Maybe Reference) lookupRef repo name = alloca $ \ptr -> do+  mapM_ (\f -> f repo name) (repoBeforeReadRef repo)   r <- withForeignPtr (repositoryPtr repo) $ \repoPtr ->         withCStringable name $ \namePtr ->           c'git_reference_lookup ptr repoPtr namePtr@@ -85,7 +86,7 @@    fptr <- newForeignPtr_ =<< peek ptr   let ref' = ref { refObj = Just fptr }-  mapM_ ($ ref') (repoOnWriteRef (refRepo ref'))+  mapM_ (\f -> f (refRepo ref') ref') (repoOnWriteRef (refRepo ref'))   return ref'  writeRef_ :: Reference -> IO ()@@ -95,7 +96,8 @@ --   const char *name)  resolveRef :: Repository -> Text -> IO (Maybe Oid)-resolveRef repos name = alloca $ \ptr ->+resolveRef repos name = alloca $ \ptr -> do+  mapM_ (\f -> f repos name) (repoBeforeReadRef repos)   withCStringable name $ \namePtr ->     withForeignPtr (repoObj repos) $ \repoPtr -> do       r <- c'git_reference_name_to_oid ptr repoPtr namePtr
gitlib.cabal view
@@ -1,5 +1,5 @@ Name:                gitlib-Version:             0.6.5+Version:             0.7.0 Synopsis:            Higher-level types for working with hlibgit2 License-file:        LICENSE License:             MIT