本文整理汇总了C#中NGit.AnyObjectId.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# AnyObjectId.Copy方法的具体用法?C# AnyObjectId.Copy怎么用?C# AnyObjectId.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGit.AnyObjectId
的用法示例。
在下文中一共展示了AnyObjectId.Copy方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TrackingRefUpdate
internal TrackingRefUpdate(bool canForceUpdate, string remoteName, string localName
, AnyObjectId oldValue, AnyObjectId newValue)
{
this.remoteName = remoteName;
this.localName = localName;
this.forceUpdate = canForceUpdate;
this.oldObjectId = oldValue.Copy();
this.newObjectId = newValue.Copy();
}
示例2: SetObjectId
/// <summary>Set the identity of the object, if its not already set.</summary>
/// <remarks>Set the identity of the object, if its not already set.</remarks>
/// <param name="id">the id of the object that is too large to process.</param>
public virtual void SetObjectId(AnyObjectId id)
{
if (objectId == null)
{
objectId = id.Copy();
}
}
示例3: LargeObject
internal LargeObject(int type, long size, FilePath path, AnyObjectId id, FileObjectDatabase
db)
{
this.type = type;
this.size = size;
this.path = path;
this.id = id.Copy();
this.source = db;
}
示例4: FindCRC32
/// <exception cref="NGit.Errors.MissingObjectException"></exception>
public override long FindCRC32(AnyObjectId objId)
{
int levelOne = objId.FirstByte;
int levelTwo = BinarySearchLevelTwo(objId, levelOne);
if (levelTwo == -1)
{
throw new MissingObjectException(objId.Copy(), "unknown");
}
return NB.DecodeUInt32(crc32[levelOne], levelTwo << 2);
}
示例5: SetNewObjectId
/// <summary>Set the new value the ref will update to.</summary>
/// <remarks>Set the new value the ref will update to.</remarks>
/// <param name="id">the new value.</param>
public virtual void SetNewObjectId(AnyObjectId id)
{
newValue = id.Copy();
}
示例6: Open
/// <exception cref="NGit.Errors.MissingObjectException"></exception>
/// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public override ObjectLoader Open(AnyObjectId objectId, int typeHint)
{
ObjectLoader ldr = db.OpenObject(this, objectId);
if (ldr == null)
{
if (typeHint == OBJ_ANY)
{
throw new MissingObjectException(objectId.Copy(), "unknown");
}
throw new MissingObjectException(objectId.Copy(), typeHint);
}
if (typeHint != OBJ_ANY && ldr.GetType() != typeHint)
{
throw new IncorrectObjectTypeException(objectId.Copy(), typeHint);
}
return ldr;
}
示例7: GetObjectSize
/// <exception cref="NGit.Errors.MissingObjectException"></exception>
/// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public override long GetObjectSize(AnyObjectId objectId, int typeHint)
{
long sz = db.GetObjectSize(this, objectId);
if (sz < 0)
{
if (typeHint == OBJ_ANY)
{
throw new MissingObjectException(objectId.Copy(), "unknown");
}
throw new MissingObjectException(objectId.Copy(), typeHint);
}
return sz;
}
示例8: RecordError
private void RecordError(AnyObjectId id, Exception what)
{
ObjectId objId = id.Copy();
IList<Exception> errors = fetchErrors.Get(objId);
if (errors == null)
{
errors = new AList<Exception>(2);
fetchErrors.Put(objId, errors);
}
errors.AddItem(what);
}
示例9: SetObjectId
/// <summary>Set the object this tag refers to, and its type.</summary>
/// <remarks>Set the object this tag refers to, and its type.</remarks>
/// <param name="obj">the object.</param>
/// <param name="objType">
/// the type of
/// <code>obj</code>
/// . Must be a valid type code.
/// </param>
public virtual void SetObjectId(AnyObjectId obj, int objType)
{
@object = obj.Copy();
type = objType;
}
示例10: Add
internal virtual bool Add(AnyObjectId toAdd)
{
int i = Index(toAdd);
for (int n = 0; n < MAX_CHAIN; )
{
ObjectId obj = ids.Get(i);
if (obj == null)
{
if (ids.CompareAndSet(i, null, toAdd.Copy()))
{
return true;
}
else
{
continue;
}
}
if (AnyObjectId.Equals(obj, toAdd))
{
return true;
}
if (++i == ids.Length())
{
i = 0;
}
n++;
}
return false;
}