@@ -1,7 +1,24 @@
11diff -ru orig/Git/S3.hs new/Git/S3.hs
2−--- orig/Git/S3.hs 2014-04-04 10:00:47.080423588 +0300
3−+++ new/Git/S3.hs 2014-04-04 10:00:46.000000000 +0300
4−@@ -467,7 +467,10 @@
2+--- orig/Git/S3.hs 2014-04-06 09:02:47.247789820 +0300
3++++ new/Git/S3.hs 2014-04-06 09:02:47.000000000 +0300
4+@@ -42,7 +42,6 @@
5+ import Control.Monad.Trans.Resource
6+ import Control.Retry
7+ import Data.Aeson as A
8+-import Data.Attempt
9+ import Data.Bifunctor
10+ import Data.Binary as Bin
11+ import Data.ByteString (ByteString)
12+@@ -141,7 +140,7 @@
13+ }
14+ deriving (Eq, Show, Generic)
15+
16+-type MonadS3 m = (Failure Git.GitException m,
17++type MonadS3 m = (MonadThrow m,
18+ MonadIO m, MonadBaseControl IO m, MonadLogger m)
19+
20+ data BackendCallbacks = BackendCallbacks
21+@@ -478,7 +477,10 @@
522 -> ResourceT m (Response (ResponseMetadata a) a)
623 awsRetry cfg svcfg mgr r =
724 transResourceT liftIO $
@@ -13,7 +30,16 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
1330
1431 listBucketS3 :: MonadS3 m => OdbS3Details -> ResourceT m [Text]
1532 listBucketS3 dets = do
16−@@ -623,7 +626,7 @@
33+@@ -622,7 +624,7 @@
34+ sha <- oidToSha oid
35+ modifyIORef mshas (sha:)
36+ return c'GIT_OK
37+- checkResult r "lgForEachObject failed"
38++ either throwM return $ checkResult r "lgForEachObject failed"
39+
40+ -- Update the known objects map with the fact that we've got a local cache
41+ -- of the pack file.
42+@@ -637,7 +639,7 @@
1743 ++ show (Prelude.length shas) ++ " objects"
1844 return shas
1945
@@ -22,7 +48,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
2248 => OdbS3Details -> Text -> FilePath -> m [SHA]
2349 catalogPackFile dets packSha idxPath = do
2450 -- Load the pack file, and iterate over the objects within it to determine
25−@@ -687,7 +690,7 @@
51+@@ -710,7 +712,7 @@
2652 lgDebug $ "cacheUpdateEntry " ++ show (shaToText sha) ++ " " ++ show ce
2753 liftIO $ atomically $ modifyTVar (knownObjects dets) $ M.insert sha ce
2854
@@ -31,7 +57,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
3157 => OdbS3Details -> SHA -> CacheEntry -> Bool
3258 -> m (Maybe ObjectInfo)
3359 cacheLoadObject dets sha ce metadataOnly = do
34−@@ -931,7 +934,7 @@
60+@@ -958,7 +960,7 @@
3561 remoteStoreObject _ _ _ =
3662 throw (Git.BackendError "remoteStoreObject was not given any data")
3763
@@ -40,7 +66,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
4066 => OdbS3Details -> ResourceT m ()
4167 remoteCatalogContents dets = do
4268 lgDebug "remoteCatalogContents"
43−@@ -955,7 +958,7 @@
69+@@ -982,7 +984,7 @@
4470
4571 | otherwise -> return ()
4672
@@ -49,7 +75,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
4975 => OdbS3Details -> SHA -> Bool -> m (Maybe CacheEntry)
5076 accessObject dets sha checkRemote = do
5177 mentry <- cacheLookupEntry dets sha
52−@@ -1000,19 +1003,19 @@
78+@@ -1032,19 +1034,19 @@
5379 -- cache and with the callback interface. This is to avoid recataloging
5480 -- in the future.
5581
@@ -72,7 +98,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
7298 => OdbS3Details -> SHA -> m (Maybe ObjectInfo)
7399 readObjectMetadata dets sha = readObject dets sha True
74100
75−@@ -1022,7 +1025,7 @@
101+@@ -1054,7 +1056,7 @@
76102 callbackRegisterObject dets sha info
77103 cacheStoreObject dets sha info
78104
@@ -81,7 +107,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
81107 => OdbS3Details -> BL.ByteString -> m ()
82108 writePackFile dets bytes = do
83109 let dir = tempDirectory dets
84−@@ -1041,7 +1044,7 @@
110+@@ -1073,7 +1075,7 @@
85111 shas <- catalogPackFile dets packSha idxPath
86112 callbackRegisterPackFile dets packSha shas
87113
@@ -90,7 +116,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
90116 => Ptr (Ptr ())
91117 -> Ptr CSize
92118 -> Ptr C'git_otype
93−@@ -1072,7 +1075,7 @@
119+@@ -1104,7 +1106,7 @@
94120 BU.unsafeUseAsCString chunk $ copyBytes p ?? len
95121 return $ p `plusPtr` len
96122
@@ -99,7 +125,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
99125 => Ptr C'git_oid
100126 -> Ptr (Ptr ())
101127 -> Ptr CSize
102−@@ -1108,7 +1111,7 @@
128+@@ -1140,7 +1142,7 @@
103129 go dets sha False
104130 | otherwise = return Nothing
105131
@@ -108,7 +134,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
108134 => Ptr CSize
109135 -> Ptr C'git_otype
110136 -> Ptr C'git_odb_backend
111−@@ -1126,7 +1129,7 @@
137+@@ -1158,7 +1160,7 @@
112138 poke len_p (toLength len)
113139 poke type_p (toType typ)
114140
@@ -117,7 +143,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
117143 => Ptr C'git_oid
118144 -> Ptr C'git_odb_backend
119145 -> Ptr ()
120−@@ -1152,7 +1155,7 @@
146+@@ -1184,7 +1186,7 @@
121147 (ObjectInfo (fromLength len) (fromType obj_type)
122148 Nothing (Just (BL.fromChunks [bytes])))
123149
@@ -126,7 +152,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
126152 => Ptr C'git_odb_backend -> Ptr C'git_oid -> CInt -> m CInt
127153 existsCallback be oid confirmNotExists = do
128154 (dets, sha) <- liftIO $ unpackDetails be oid
129−@@ -1162,18 +1165,18 @@
155+@@ -1194,18 +1196,18 @@
130156 return $ if ce == DoesNotExist then 0 else 1)
131157 (return c'GIT_ERROR)
132158
@@ -148,7 +174,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
148174 => Ptr (Ptr C'git_odb_writepack)
149175 -> Ptr C'git_odb_backend
150176 -> C'git_transfer_progress_callback
151−@@ -1214,7 +1217,7 @@
177+@@ -1248,7 +1250,7 @@
152178 foreign import ccall "&freeCallback"
153179 freeCallbackPtr :: FunPtr F'git_odb_backend_free_callback
154180
@@ -157,7 +183,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
157183 => Ptr C'git_odb_writepack
158184 -> Ptr ()
159185 -> CSize
160−@@ -1233,7 +1236,7 @@
186+@@ -1267,7 +1269,7 @@
161187 (castPtr dataPtr) (fromIntegral len)
162188 writePackFile dets (BL.fromChunks [bytes])
163189
@@ -166,7 +192,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
166192 => Ptr C'git_odb_writepack -> Ptr C'git_transfer_progress
167193 -> m CInt
168194 packCommitCallback _wp _progress =
169−@@ -1346,7 +1349,7 @@
195+@@ -1380,7 +1382,7 @@
170196 liftIO $ writeIORef result res
171197 readIORef result
172198
@@ -175,7 +201,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
175201 => Aws.S3Configuration NormalQuery
176202 -> Configuration
177203 -> Manager
178−@@ -1439,7 +1442,7 @@
204+@@ -1475,7 +1477,7 @@
179205
180206 -- | Given a repository object obtained from Libgit2, add an S3 backend to it,
181207 -- making it the primary store for objects associated with that repository.
@@ -184,7 +210,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
184210 => LgRepo
185211 -> Text -- ^ bucket
186212 -> Text -- ^ prefix
187−@@ -1469,7 +1472,7 @@
213+@@ -1505,7 +1507,7 @@
188214 void $ liftIO $ odbBackendAdd repo odbS3 100
189215 return repo
190216
@@ -193,7 +219,7 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
193219 => Maybe Text -> Text -> Text -> FilePath -> BackendCallbacks
194220 -> Git.RepositoryFactory (ReaderT LgRepo (NoLoggingT m)) m LgRepo
195221 s3Factory bucket accessKey secretKey dir callbacks = lgFactory
196−@@ -1492,7 +1495,7 @@
222+@@ -1528,7 +1530,7 @@
197223 dir
198224 callbacks
199225
@@ -203,9 +229,23 @@ diff -ru orig/Git/S3.hs new/Git/S3.hs
203229 -> Git.RepositoryFactory (ReaderT LgRepo m) m LgRepo
204230 s3FactoryLogger bucket accessKey secretKey dir callbacks = lgFactoryLogger
205231diff -ru orig/gitlib-s3.cabal new/gitlib-s3.cabal
206−--- orig/gitlib-s3.cabal 2014-04-04 10:00:47.084423588 +0300
207−+++ new/gitlib-s3.cabal 2014-04-04 10:00:46.000000000 +0300
208−@@ -58,6 +58,7 @@
232+--- orig/gitlib-s3.cabal 2014-04-06 09:02:47.247789820 +0300
233++++ new/gitlib-s3.cabal 2014-04-06 09:02:47.000000000 +0300
234+@@ -33,7 +33,6 @@
235+ , hspec-expectations >= 0.3
236+ , data-default >= 0.5.1
237+ , directory >= 1.1.0.2
238+- , failure >= 0.2.0.1
239+ , filepath >= 1.3.0
240+ , monad-logger >= 0.3.1.1
241+ , resourcet >= 0.4.6
242+@@ -52,12 +51,12 @@
243+ , ghc-prim
244+ , hlibgit2 >= 0.18.0.11
245+ , aeson >= 0.6.1.0
246+- , attempt >= 0.4.0
247+ , aws >= 0.7.5
248+ , bifunctors >= 3.2.0.1
209249 , binary >= 0.5.1.0
210250 , bytestring >= 0.9.2.1
211251 , conduit >= 0.5.5
@@ -214,14 +254,23 @@ diff -ru orig/gitlib-s3.cabal new/gitlib-s3.cabal
214254 , directory >= 1.1.0.2
215255 , filepath >= 1.3.0
216256diff -ru orig/test/Smoke.hs new/test/Smoke.hs
217−--- orig/test/Smoke.hs 2014-04-04 10:00:47.080423588 +0300
218−+++ new/test/Smoke.hs 2014-04-04 10:00:46.000000000 +0300
219−@@ -31,7 +31,7 @@
257+--- orig/test/Smoke.hs 2014-04-06 09:02:47.247789820 +0300
258++++ new/test/Smoke.hs 2014-04-06 09:02:47.000000000 +0300
259+@@ -11,7 +11,6 @@
260+
261+ import Aws
262+ import Control.Applicative
263+-import Control.Failure
264+ import Control.Monad.IO.Class
265+ import Control.Monad.Logger
266+ import Control.Monad.Trans.Reader
267+@@ -30,8 +29,7 @@
268+ import Test.Hspec.Runner
220269
221270 s3Factory
222− :: (Failure Git.GitException m, MonadIO m, MonadBaseControl IO m,
271+- :: (Failure Git.GitException m, MonadIO m, MonadBaseControl IO m,
223272- MonadUnsafeIO m, MonadThrow m)
224−+ MonadThrow m)
273++ :: (MonadThrow m, MonadIO m, MonadBaseControl IO m)
225274 => Git.RepositoryFactory (ReaderT Lg.LgRepo (NoLoggingT m)) m Lg.LgRepo
226275 s3Factory = Lg.lgFactory
227276 { Git.runRepository = \ctxt m ->