diff --git a/Git/Libgit2.hs b/Git/Libgit2.hs
--- a/Git/Libgit2.hs
+++ b/Git/Libgit2.hs
@@ -26,6 +26,7 @@
        , Repository(..)
        , Tree()
        , TreeOid()
+       , repoPath
        , addTracingBackend
        , checkResult
        , closeLgRepository
@@ -39,7 +40,7 @@
        , lgBuildPackFile
        , lgReadFromPack
        , lgWithPackFile
-       , lgWritePackFile
+       , lgCopyPackFile
        , lgWrap
        , oidToSha
        , shaToOid
@@ -97,8 +98,8 @@
 import           Unsafe.Coerce
 
 debug :: MonadIO m => String -> m ()
-debug = liftIO . putStrLn
---debug = const (return ())
+--debug = liftIO . putStrLn
+debug = const (return ())
 
 type Oid = OidPtr
 
@@ -587,17 +588,17 @@
     repo <- lgGet
     result <- liftIO $ withForeignPtr (repoObj repo) $ \repoPtr ->
         alloca $ \pptr -> do
-            r0 <- c'git_repository_odb pptr repoPtr
-            if r0 < 0
+            r <- c'git_repository_odb pptr repoPtr
+            if r < 0
                 then return Nothing
                 else
                 -- jww (2013-02-28): Need to guard against exceptions so that
                 -- ptr doesn't leak.
                 withForeignPtr (getOid oid) $ \coid -> do
                     ptr <- peek pptr
-                    r <- c'git_odb_exists ptr coid 0
+                    r1 <- c'git_odb_exists ptr coid 0
                     c'git_odb_free ptr
-                    return (Just (r == 0))
+                    return (Just (r1 == 0))
     maybe (failure Git.RepositoryInvalid) return result
 
 lgForEachObject :: Ptr C'git_odb
@@ -737,20 +738,26 @@
             -> LgRepository m ()
 lgUpdateRef name refTarg = do
     repo <- lgGet
-    liftIO $ alloca $ \ptr ->
+    r <- liftIO $ alloca $ \ptr ->
         withForeignPtr (repoObj repo) $ \repoPtr ->
         withCString (T.unpack name) $ \namePtr -> do
-            r <- case refTarg of
+            case refTarg of
                 Git.RefObj oid ->
                     withForeignPtr (getOid (untag oid)) $ \coidPtr ->
                         c'git_reference_create ptr repoPtr namePtr
                                                coidPtr (fromBool True)
 
                 Git.RefSymbolic symName ->
-                  withCString (T.unpack symName) $ \symPtr ->
-                    c'git_reference_symbolic_create ptr repoPtr namePtr
-                                                    symPtr (fromBool True)
-            when (r < 0) $ failure Git.ReferenceCreateFailed
+                    withCString (T.unpack symName) $ \symPtr ->
+                        c'git_reference_symbolic_create ptr repoPtr namePtr
+                                                        symPtr (fromBool True)
+    when (r < 0) $ do
+        errStr <- liftIO $ do
+            errPtr <- c'giterr_last
+            err    <- peek errPtr
+            peekCString (c'git_error'message err)
+        failure (Git.ReferenceCreateFailed $ name <> " => "
+                 <> T.pack (show refTarg) <> ": " <> T.pack errStr)
 
 -- int git_reference_name_to_oid(git_oid *out, git_repository *repo,
 --   const char *name)
@@ -1023,8 +1030,8 @@
         c'git_oid_fromraw ptr' (castPtr bytes)
         return ptr
 
-lgWritePackFile :: Git.MonadGit m => FilePath -> LgRepository m ()
-lgWritePackFile packFile = do
+lgCopyPackFile :: Git.MonadGit m => FilePath -> LgRepository m ()
+lgCopyPackFile packFile = do
     -- jww (2013-04-23): This would be much more efficient (we already have
     -- the pack file on disk, why not just copy it?), but we have no way at
     -- present of communicating with the S3 backend directly.
diff --git a/gitlib-libgit2.cabal b/gitlib-libgit2.cabal
--- a/gitlib-libgit2.cabal
+++ b/gitlib-libgit2.cabal
@@ -1,5 +1,5 @@
 Name:                gitlib-libgit2
-Version:             2.0.1.0
+Version:             2.0.2.1
 Synopsis:            Libgit2 backend for gitlib
 License-file:        LICENSE
 License:             MIT
@@ -25,7 +25,7 @@
           base >=3
         , gitlib             >= 2.0.1.0
         , gitlib-test        >= 2.0.0.0
-        , gitlib-libgit2     >= 2.0.1.0
+        , gitlib-libgit2     >= 2.0.2.1
         , HUnit              >= 1.2.5
         , hspec              >= 1.4.4
         , hspec-expectations >= 0.3
@@ -37,7 +37,7 @@
     build-depends:
           base                 >= 3 && < 5
         , gitlib               >= 2.0.1.0
-        , hlibgit2             >= 0.18.0.7
+        , hlibgit2             >= 0.18.0.9
         , attempt              >= 0.4.0
         , binary               >= 0.5.1.0
         , bytestring           >= 0.9.2.1
