当前位置: 首页>>代码示例>>C#>>正文


C# Ref.GetObjectId方法代码示例

本文整理汇总了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());
				}
			}
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:23,代码来源:BundleWriter.cs

示例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;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:17,代码来源:RefUpdate.cs

示例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);
 }
开发者ID:kenji-tan,项目名称:ngit,代码行数:31,代码来源:FetchProcess.cs

示例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());
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:12,代码来源:FetchProcess.cs

示例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);
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:21,代码来源:FetchProcess.cs

示例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)
        {
        }
开发者ID:kenji-tan,项目名称:ngit,代码行数:50,代码来源:RemoteRefUpdate.cs


注:本文中的Ref.GetObjectId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。