Пример #1
0
 internal static void CopyAllBlobs(this ObjectDatabase source, OdbBackend backend)
 {
     foreach (var blob in source.OfType <Blob>())
     {
         if (!backend.Exists(blob.Id))
         {
             var stream = blob.GetContentStream();
             backend.Write(blob.Id, stream, stream.Length, ObjectType.Blob);
         }
     }
 }
Пример #2
0
            private static bool Exists(
                IntPtr backend,
                ref GitOid oid)
            {
                OdbBackend odbBackend = GCHandle.FromIntPtr(Marshal.ReadIntPtr(backend, GitOdbBackend.GCHandleOffset)).Target as OdbBackend;

                if (odbBackend != null)
                {
                    try
                    {
                        return(odbBackend.Exists(oid.Id));
                    }
                    catch (Exception ex)
                    {
                        Proxy.giterr_set_str(GitErrorCategory.Odb, ex);
                    }
                }

                return(false);
            }
Пример #3
0
            private static bool Exists(
                IntPtr backend,
                ref GitOid oid)
            {
                OdbBackend odbBackend = MarshalOdbBackend(backend);

                if (odbBackend == null)
                {
                    return(false); // Weird
                }

                try
                {
                    return(odbBackend.Exists(new ObjectId(oid)));
                }
                catch (Exception ex)
                {
                    Proxy.giterr_set_str(GitErrorCategory.Odb, ex);
                    return(false);
                }
            }