/// <exception cref="NGit.Errors.NoWorkTreeException"></exception> /// <exception cref="System.IO.IOException"></exception> public static void ValidateIndex(Git git) { DirCache dc = git.GetRepository().LockDirCache(); ObjectReader r = git.GetRepository().ObjectDatabase.NewReader(); try { for (int i = 0; i < dc.GetEntryCount(); ++i) { DirCacheEntry entry = dc.GetEntry(i); if (entry.Length > 0) { NUnit.Framework.Assert.AreEqual(entry.Length, r.GetObjectSize(entry.GetObjectId() , ObjectReader.OBJ_ANY)); } } } finally { dc.Unlock(); r.Release(); } }
/// <exception cref="System.IO.IOException"></exception> public override long Size(string path, ObjectId id) { return(reader.GetObjectSize(id, Constants.OBJ_BLOB)); }