本文整理汇总了C#中NGit.AnyObjectId.ToObjectId方法的典型用法代码示例。如果您正苦于以下问题:C# AnyObjectId.ToObjectId方法的具体用法?C# AnyObjectId.ToObjectId怎么用?C# AnyObjectId.ToObjectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGit.AnyObjectId
的用法示例。
在下文中一共展示了AnyObjectId.ToObjectId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Include
/// <summary>Include an object (and everything reachable from it) in the bundle.</summary>
/// <remarks>Include an object (and everything reachable from it) in the bundle.</remarks>
/// <param name="name">
/// name the recipient can discover this object as from the
/// bundle's list of advertised refs . The name must be a valid
/// ref format and must not have already been included in this
/// bundle writer.
/// </param>
/// <param name="id">object to pack. Multiple refs may point to the same object.</param>
public virtual void Include(string name, AnyObjectId id)
{
if (!Repository.IsValidRefName(name))
{
throw new ArgumentException(MessageFormat.Format(JGitText.Get().invalidRefName, name
));
}
if (include.ContainsKey(name))
{
throw new InvalidOperationException(JGitText.Get().duplicateRef + name);
}
include.Put(name, id.ToObjectId());
}
示例2: AddTree
/// <summary>Recursively add an entire tree into this builder.</summary>
/// <remarks>
/// Recursively add an entire tree into this builder.
/// <p>
/// If pathPrefix is "a/b" and the tree contains file "c" then the resulting
/// DirCacheEntry will have the path "a/b/c".
/// <p>
/// All entries are inserted at stage 0, therefore assuming that the
/// application will not insert any other paths with the same pathPrefix.
/// </remarks>
/// <param name="pathPrefix">
/// UTF-8 encoded prefix to mount the tree's entries at. If the
/// path does not end with '/' one will be automatically inserted
/// as necessary.
/// </param>
/// <param name="stage">stage of the entries when adding them.</param>
/// <param name="reader">
/// reader the tree(s) will be read from during recursive
/// traversal. This must be the same repository that the resulting
/// DirCache would be written out to (or used in) otherwise the
/// caller is simply asking for deferred MissingObjectExceptions.
/// Caller is responsible for releasing this reader when done.
/// </param>
/// <param name="tree">
/// the tree to recursively add. This tree's contents will appear
/// under <code>pathPrefix</code>. The ObjectId must be that of a
/// tree; the caller is responsible for dereferencing a tag or
/// commit (if necessary).
/// </param>
/// <exception cref="System.IO.IOException">a tree cannot be read to iterate through its entries.
/// </exception>
public virtual void AddTree(byte[] pathPrefix, int stage, ObjectReader reader, AnyObjectId
tree)
{
TreeWalk tw = new TreeWalk(reader);
tw.AddTree(new CanonicalTreeParser(pathPrefix, reader, tree.ToObjectId()));
tw.Recursive = true;
if (tw.Next())
{
DirCacheEntry newEntry = ToEntry(stage, tw);
BeforeAdd(newEntry);
FastAdd(newEntry);
while (tw.Next())
{
FastAdd(ToEntry(stage, tw));
}
}
}
示例3: AdvertiseAny
/// <exception cref="System.IO.IOException"></exception>
private void AdvertiseAny(AnyObjectId obj, string refName)
{
sent.AddItem(obj.ToObjectId());
AdvertiseId(obj, refName);
}
示例4: SetExpectedOldObjectId
/// <param name="id">
/// the expected value of the ref after the lock is taken, but
/// before update occurs. Null to avoid the compare and swap test.
/// Use
/// <see cref="ObjectId.ZeroId()">ObjectId.ZeroId()</see>
/// to indicate expectation of a
/// non-existant ref.
/// </param>
public virtual void SetExpectedOldObjectId(AnyObjectId id)
{
expValue = id != null ? id.ToObjectId() : null;
}
示例5: CorruptObjectException
/// <summary>
/// Construct a CorruptObjectException for reporting a problem specified
/// object id
/// </summary>
/// <param name="id"></param>
/// <param name="why"></param>
public CorruptObjectException(AnyObjectId id, string why) : this(id.ToObjectId(),
why)
{
}