gitlib-s3 2.0.1.0 → 2.0.2.1
raw patch · 2 files changed
+18/−32 lines, 2 filesdep ~gitlib-libgit2dep ~gitlib-s3dep ~hlibgit2
Dependency ranges changed: gitlib-libgit2, gitlib-s3, hlibgit2
Files
- Git/S3.hs +12/−26
- gitlib-s3.cabal +6/−6
Git/S3.hs view
@@ -94,6 +94,10 @@ import Network.HTTP.Conduit hiding (Response) import Prelude hiding (FilePath, mapM_, catch) import System.IO.Unsafe++debug :: MonadIO m => String -> m ()+debug = liftIO . putStrLn+--debug = const (return ()) newtype ObjectLength = ObjectLength { getObjectLength :: Int64 } deriving (Eq, Show, Generic)@@ -303,10 +307,6 @@ pokeByteOff p sizev2 v2 return () -debug :: MonadIO m => String -> m ()---debug = liftIO . putStrLn-debug = const (return ())- toType :: ObjectType -> C'git_otype toType (ObjectType t) = fromIntegral t @@ -863,9 +863,9 @@ idxPath = replaceExtension packPath "idx" runMaybeT $ do- -- jww (2013-07-14): We cannot derive a list of all the objects in the- -- pack file by only reading the index. This should be possible, but- -- did not work for me in testing of Bug #1953.+ -- jww (2013-07-22): It would help performance if we could drop the+ -- "True ||" here, but right now this is not working with the current+ -- libgit2. when (True || readPackAndIndex) $ do exists <- liftIO $ isFile packPath void $ if exists@@ -938,16 +938,10 @@ | ".pack" `T.isSuffixOf` item -> return () - -- jww (2013-07-14): Don't catalog loose objects, which may include- -- loose blobs that are used for indices, which would then cause- -- the contents of the index to immediately change. Loose objects- -- can be rediscovered easily with a call to testFileS3, so it's not- -- important to recache them here.-- -- | T.length item == 40 -> liftIO $ do- -- sha <- Git.textToSha . pathText . basename . fromText $ item- -- cacheUpdateEntry dets sha LooseRemote- -- callbackRegisterCacheEntry dets sha LooseRemote+ | T.length item == 40 -> liftIO $ do+ sha <- Git.textToSha . pathText . basename . fromText $ item+ cacheUpdateEntry dets sha LooseRemote+ callbackRegisterCacheEntry dets sha LooseRemote | otherwise -> return () @@ -1007,15 +1001,7 @@ readObject :: OdbS3Details -> SHA -> Bool -> IO (Maybe ObjectInfo) readObject dets sha metadataOnly = do ce <- objectExists dets sha True-- -- By passing False to 'objectExists', we force it to query only the local- -- cache and database registry for information about the object, and not- -- Amazon. If it's unknown, we make the assumption that it exists loosely- -- on S3, as this will almost always be the case with objects saved by the- -- School of Haskell (which does not use packs).- let ce' = case ce of DoesNotExist -> LooseRemote; _ -> ce- cacheLoadObject dets sha ce' metadataOnly- `catch` \(_ :: SomeException) -> return Nothing+ cacheLoadObject dets sha ce metadataOnly `orElse` return Nothing readObjectMetadata :: OdbS3Details -> SHA -> IO (Maybe ObjectInfo) readObjectMetadata dets sha = readObject dets sha True
gitlib-s3.cabal view
@@ -1,5 +1,5 @@ Name: gitlib-s3-Version: 2.0.1.0+Version: 2.0.2.1 Synopsis: Gitlib repository backend for storing Git objects in Amazon S3 Description: Gitlib repository backend for storing Git objects in Amazon S3. License-file: LICENSE@@ -23,10 +23,10 @@ build-depends: base >=3 , gitlib >= 2.0.1.0- , gitlib-s3 >= 2.0.1.0+ , gitlib-s3 >= 2.0.2.0 , gitlib-test >= 2.0.0.0- , gitlib-libgit2 >= 2.0.1.0- , hlibgit2 >= 0.18.0.7+ , gitlib-libgit2 >= 2.0.2.1+ , hlibgit2 >= 0.18.0.9 , aws >= 0.7.5 , HUnit >= 1.2.5 , hspec >= 1.4.4@@ -46,9 +46,9 @@ build-depends: base >= 3 && < 5 , gitlib >= 2.0.1.0- , gitlib-libgit2 >= 2.0.1.0+ , gitlib-libgit2 >= 2.0.2.1 , ghc-prim- , hlibgit2 >= 0.18.0.7+ , hlibgit2 >= 0.18.0.9 , HUnit >= 1.2.5 , aeson >= 0.6.1.0 , attempt >= 0.4.0