本文整理汇总了C#中Ref.GetObjectId方法的典型用法代码示例。如果您正苦于以下问题:C# Ref.GetObjectId方法的具体用法?C# Ref.GetObjectId怎么用?C# Ref.GetObjectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ref
的用法示例。
在下文中一共展示了Ref.GetObjectId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Include
/// <summary>Include a single ref (a name/object pair) in the bundle.</summary>
/// <remarks>
/// Include a single ref (a name/object pair) in the bundle.
/// <p>
/// This is a utility function for:
/// <code>include(r.getName(), r.getObjectId())</code>.
/// </remarks>
/// <param name="r">the ref to include.</param>
public virtual void Include(Ref r)
{
Include(r.GetName(), r.GetObjectId());
if (r.GetPeeledObjectId() != null)
{
tagTargets.AddItem(r.GetPeeledObjectId());
}
else
{
if (r.GetObjectId() != null && r.GetName().StartsWith(Constants.R_HEADS))
{
tagTargets.AddItem(r.GetObjectId());
}
}
}
示例2: RefUpdate
/// <summary>Construct a new update operation for the reference.</summary>
/// <remarks>
/// Construct a new update operation for the reference.
/// <p>
/// <code>ref.getObjectId()</code>
/// will be used to seed
/// <see cref="GetOldObjectId()">GetOldObjectId()</see>
/// ,
/// which callers can use as part of their own update logic.
/// </remarks>
/// <param name="ref">the reference that will be updated by this operation.</param>
protected internal RefUpdate(Ref @ref)
{
[email protected] = @ref;
oldValue = @ref.GetObjectId();
refLogMessage = string.Empty;
}
示例3: Want
/// <exception cref="NGit.Errors.TransportException"></exception>
private void Want(Ref src, RefSpec spec)
{
ObjectId newId = src.GetObjectId();
if (spec.GetDestination() != null)
{
try
{
TrackingRefUpdate tru = CreateUpdate(spec, newId);
if (newId.Equals(tru.GetOldObjectId()))
{
return;
}
localUpdates.AddItem(tru);
}
catch (IOException err)
{
// Bad symbolic ref? That is the most likely cause.
//
throw new TransportException(MessageFormat.Format(JGitText.Get().cannotResolveLocalTrackingRefForUpdating
, spec.GetDestination()), err);
}
}
askFor.Put(newId, src);
FetchHeadRecord fhr = new FetchHeadRecord();
fhr.newValue = newId;
fhr.notForMerge = spec.GetDestination() != null;
fhr.sourceName = src.GetName();
fhr.sourceURI = transport.GetURI();
fetchHeadUpdates.AddItem(fhr);
}
示例4: DeleteTrackingRef
private void DeleteTrackingRef(FetchResult result, BatchRefUpdate batch, RefSpec
spec, Ref localRef)
{
if (localRef.GetObjectId() == null)
{
return;
}
TrackingRefUpdate update = new TrackingRefUpdate(true, spec.GetSource(), localRef
.GetName(), localRef.GetObjectId(), ObjectId.ZeroId);
result.Add(update);
batch.AddCommand(update.AsReceiveCommand());
}
示例5: Want
/// <exception cref="NGit.Errors.TransportException"></exception>
private void Want(Ref src, RefSpec spec)
{
ObjectId newId = src.GetObjectId();
if (spec.GetDestination() != null)
{
TrackingRefUpdate tru = CreateUpdate(spec, newId);
if (newId.Equals(tru.GetOldObjectId()))
{
return;
}
localUpdates.AddItem(tru);
}
askFor.Put(newId, src);
FetchHeadRecord fhr = new FetchHeadRecord();
fhr.newValue = newId;
fhr.notForMerge = spec.GetDestination() != null;
fhr.sourceName = src.GetName();
fhr.sourceURI = transport.GetURI();
fetchHeadUpdates.AddItem(fhr);
}
示例6: RemoteRefUpdate
/// <summary>Construct remote ref update request by providing an update specification.
/// </summary>
/// <remarks>
/// Construct remote ref update request by providing an update specification.
/// Object is created with default
/// <see cref="Status.NOT_ATTEMPTED">Status.NOT_ATTEMPTED</see>
/// status and no
/// message.
/// </remarks>
/// <param name="localDb">local repository to push from.</param>
/// <param name="srcRef">source revision. Use null to delete.</param>
/// <param name="remoteName">
/// full name of a remote ref to update, e.g. "refs/heads/master"
/// (no wildcard, no short name).
/// </param>
/// <param name="forceUpdate">
/// true when caller want remote ref to be updated regardless
/// whether it is fast-forward update (old object is ancestor of
/// new object).
/// </param>
/// <param name="localName">
/// optional full name of a local stored tracking branch, to
/// update after push, e.g. "refs/remotes/zawir/dirty" (no
/// wildcard, no short name); null if no local tracking branch
/// should be updated.
/// </param>
/// <param name="expectedOldObjectId">
/// optional object id that caller is expecting, requiring to be
/// advertised by remote side before update; update will take
/// place ONLY if remote side advertise exactly this expected id;
/// null if caller doesn't care what object id remote side
/// advertise. Use
/// <see cref="NGit.ObjectId.ZeroId()">NGit.ObjectId.ZeroId()</see>
/// when expecting no
/// remote ref with this name.
/// </param>
/// <exception cref="System.IO.IOException">
/// when I/O error occurred during creating
/// <see cref="TrackingRefUpdate">TrackingRefUpdate</see>
/// for local tracking branch or srcRef
/// can't be resolved to any object.
/// </exception>
/// <exception cref="System.ArgumentException">if some required parameter was null</exception>
public RemoteRefUpdate(Repository localDb, Ref srcRef, string remoteName, bool forceUpdate
, string localName, ObjectId expectedOldObjectId)
: this(localDb, srcRef != null
? srcRef.GetName() : null, srcRef != null ? srcRef.GetObjectId() : null, remoteName
, forceUpdate, localName, expectedOldObjectId)
{
}