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

read() public static method

Create a new in-core index representation and read an index from disk. The new index will be read before it is returned to the caller. Read failures are reported as exceptions and therefore prevent the method from returning a partially populated index.
/// The index file is present but could not be read. /// /// The index file is using a format or extension that this /// library does not support. ///
public static read ( FileInfo indexLocation ) : DirCache
indexLocation System.IO.FileInfo Location of the index file on disk.
return DirCache
		public static DirCache read(FileInfo indexLocation)
		{
			var c = new DirCache(indexLocation);
			c.read();
			return c;
		}

Same methods

DirCache::read ( Repository db ) : DirCache
DirCache::read ( ) : void

Usage Example

Example #1
0
        ///	<summary>
        /// Create a new in-core index representation and read an index from disk.
        ///	<para />
        ///	The new index will be read before it is returned to the caller. Read
        /// failures are reported as exceptions and therefore prevent the method from
        /// returning a partially populated index.
        /// </summary>
        /// <param name="indexLocation">Location of the index file on disk.</param>
        /// <returns> a cache representing the contents of the specified index file (if
        /// it exists) or an empty cache if the file does not exist.
        /// </returns>
        /// <exception cref="IOException">
        /// The index file is present but could not be read.
        /// </exception>
        /// <exception cref="CorruptObjectException">
        /// The index file is using a format or extension that this
        /// library does not support.
        /// </exception>
        public static DirCache read(FileInfo indexLocation)
        {
            var c = new DirCache(indexLocation);

            c.read();
            return(c);
        }
All Usage Examples Of GitSharp.Core.DirectoryCache.DirCache::read