GitSharp.Core.DirectoryCache.DirCache.getCacheTree C# (CSharp) Method

getCacheTree() public method

Obtain (or build) the current cache tree structure. This method can optionally recreate the cache tree, without flushing the tree objects themselves to disk.
public getCacheTree ( bool build ) : DirCacheTree
build bool /// If true and the cache tree is not present in the index it will /// be generated and returned to the caller. ///
return DirCacheTree
		public DirCacheTree getCacheTree(bool build)
		{
			if (build)
			{
				if (_cacheTree == null)
				{
					_cacheTree = new DirCacheTree();
				}
				_cacheTree.validate(_sortedEntries, _entryCnt, 0, 0);
			}
			return _cacheTree;
		}

Usage Example

Example #1
0
        /// <summary>
        /// Create a new iterator for an already loaded DirCache instance.
        /// <para/>
        /// The iterator implementation may copy part of the cache's data during
        /// construction, so the cache must be Read in prior to creating the
        /// iterator.
        /// </summary>
        /// <param name="dc">
        /// The cache to walk. It must be already loaded into memory.
        /// </param>
        public DirCacheIterator(DirCache dc)
        {
            Cache     = dc;
            Tree      = dc.getCacheTree(true);
            TreeStart = 0;
            TreeEnd   = Tree.getEntrySpan();
            SubtreeId = new byte[Constants.OBJECT_ID_LENGTH];

            if (!eof())
            {
                ParseEntry();
            }
        }
All Usage Examples Of GitSharp.Core.DirectoryCache.DirCache::getCacheTree