本文整理汇总了C#中Repository.NewObjectReader方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.NewObjectReader方法的具体用法?C# Repository.NewObjectReader怎么用?C# Repository.NewObjectReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository.NewObjectReader方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Merger
/// <summary>Create a new merge instance for a repository.</summary>
/// <remarks>Create a new merge instance for a repository.</remarks>
/// <param name="local">the repository this merger will read and write data on.</param>
protected internal Merger(Repository local)
{
db = local;
reader = db.NewObjectReader();
walk = new RevWalk(reader);
}
示例2: ObjectWalk
/// <summary>Create a new revision and object walker for a given repository.</summary>
/// <remarks>Create a new revision and object walker for a given repository.</remarks>
/// <param name="repo">the repository the walker will obtain data from.</param>
public ObjectWalk(Repository repo) : this(repo.NewObjectReader())
{
}
示例3: WalkFetchConnection
internal WalkFetchConnection(WalkTransport t, WalkRemoteObjectDatabase w)
{
NGit.Transport.Transport wt = (NGit.Transport.Transport)t;
local = wt.local;
objCheck = wt.IsCheckFetchedObjects() ? new ObjectChecker() : null;
inserter = local.NewObjectInserter();
reader = local.NewObjectReader();
remotes = new AList<WalkRemoteObjectDatabase>();
remotes.AddItem(w);
unfetchedPacks = new List<WalkFetchConnection.RemotePack>();
packsConsidered = new HashSet<string>();
noPacksYet = new List<WalkRemoteObjectDatabase>();
noPacksYet.AddItem(w);
noAlternatesYet = new List<WalkRemoteObjectDatabase>();
noAlternatesYet.AddItem(w);
fetchErrors = new Dictionary<ObjectId, IList<Exception>>();
packLocks = new AList<PackLock>(4);
revWalk = new RevWalk(reader);
revWalk.SetRetainBody(false);
treeWalk = new TreeWalk(reader);
COMPLETE = revWalk.NewFlag("COMPLETE");
IN_WORK_QUEUE = revWalk.NewFlag("IN_WORK_QUEUE");
LOCALLY_SEEN = revWalk.NewFlag("LOCALLY_SEEN");
localCommitQueue = new DateRevQueue();
workQueue = new List<ObjectId>();
}
示例4: CheckoutEntry
/// <summary>
/// Updates the file in the working tree with content and mode from an entry
/// in the index.
/// </summary>
/// <remarks>
/// Updates the file in the working tree with content and mode from an entry
/// in the index. The new content is first written to a new temporary file in
/// the same directory as the real file. Then that new file is renamed to the
/// final filename. Use this method only for checkout of a single entry.
/// Otherwise use
/// <code>checkoutEntry(Repository, File f, DirCacheEntry, ObjectReader)</code>
/// instead which allows to reuse one
/// <code>ObjectReader</code>
/// for multiple
/// entries.
/// <p>
/// TODO: this method works directly on File IO, we may need another
/// abstraction (like WorkingTreeIterator). This way we could tell e.g.
/// Eclipse that Files in the workspace got changed
/// </p>
/// </remarks>
/// <param name="repository"></param>
/// <param name="f">
/// the file to be modified. The parent directory for this file
/// has to exist already
/// </param>
/// <param name="entry">the entry containing new mode and content</param>
/// <exception cref="System.IO.IOException">System.IO.IOException</exception>
public static void CheckoutEntry(Repository repository, FilePath f, DirCacheEntry
entry)
{
ObjectReader or = repository.NewObjectReader();
try
{
CheckoutEntry(repository, f, entry, repository.NewObjectReader());
}
finally
{
or.Release();
}
}
示例5: Read
/// <exception cref="NGit.Errors.MissingObjectException"></exception>
/// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception>
/// <exception cref="System.IO.IOException"></exception>
private static byte[] Read(Repository db, AnyObjectId blobId)
{
ObjectReader or = db.NewObjectReader();
try
{
return Read(or, blobId);
}
finally
{
or.Release();
}
}
示例6: NameConflictTreeWalk
/// <summary>Create a new tree walker for a given repository.</summary>
/// <remarks>Create a new tree walker for a given repository.</remarks>
/// <param name="repo">the repository the walker will obtain data from.</param>
public NameConflictTreeWalk(Repository repo) : this(repo.NewObjectReader())
{
}
示例7: NoteMapMerger
/// <summary>
/// Constructs a NoteMapMerger with custom
/// <see cref="NoteMerger">NoteMerger</see>
/// and custom
/// <see cref="NGit.Merge.MergeStrategy">NGit.Merge.MergeStrategy</see>
/// .
/// </summary>
/// <param name="db">Git repository</param>
/// <param name="noteMerger">note merger for merging conflicting changes on a note</param>
/// <param name="nonNotesMergeStrategy">merge strategy for merging non-note entries</param>
public NoteMapMerger(Repository db, NoteMerger noteMerger, MergeStrategy nonNotesMergeStrategy
)
{
this.db = db;
this.reader = db.NewObjectReader();
this.inserter = db.NewObjectInserter();
this.noteMerger = noteMerger;
this.nonNotesMergeStrategy = nonNotesMergeStrategy;
this.objectIdPrefix = new MutableObjectId();
}