當前位置: 首頁>>代碼示例>>C#>>正文


C# AnyObjectId.ToObjectId方法代碼示例

本文整理匯總了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());
		}
開發者ID:LunarLanding,項目名稱:ngit,代碼行數:22,代碼來源:BundleWriter.cs

示例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));
				}
			}
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:48,代碼來源:DirCacheBuilder.cs

示例3: AdvertiseAny

		/// <exception cref="System.IO.IOException"></exception>
		private void AdvertiseAny(AnyObjectId obj, string refName)
		{
			sent.AddItem(obj.ToObjectId());
			AdvertiseId(obj, refName);
		}
開發者ID:stewartwhaley,項目名稱:monodevelop,代碼行數:6,代碼來源:RefAdvertiser.cs

示例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;
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:12,代碼來源:RefUpdate.cs

示例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)
		{
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:10,代碼來源:CorruptObjectException.cs


注:本文中的NGit.AnyObjectId.ToObjectId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。