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


C# AnyObjectId类代码示例

本文整理汇总了C#中AnyObjectId的典型用法代码示例。如果您正苦于以下问题:C# AnyObjectId类的具体用法?C# AnyObjectId怎么用?C# AnyObjectId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AnyObjectId类属于命名空间,在下文中一共展示了AnyObjectId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PlotCommit

 /// <summary>
 /// Create a new commit.
 /// </summary>
 /// <param name="id">the identity of this commit.</param>
 /// <param name="tags">the tags associated with this commit, null for no tags</param>
 public PlotCommit(AnyObjectId id, Ref[] tags)
     : base(id)
 {
     this.refs = tags;
     passingLanes = NO_LANES;
     children = NO_CHILDREN;
 }
开发者ID:ermshiperete,项目名称:GitSharp,代码行数:12,代码来源:PlotCommit.cs

示例2: include

 public void include(string name, AnyObjectId id)
 {
     if (!Repository.IsValidRefName(name))
         throw new ArgumentException("Invalid ref name: " + name, "name");
     if (includeObjects.ContainsKey(name))
         throw new ApplicationException("Duplicate ref: " + name);
     includeObjects.Add(name, id.ToObjectId());
 }
开发者ID:mneedham,项目名称:GitSharp,代码行数:8,代码来源:BundleWriter.cs

示例3: TrackingRefUpdate

 public TrackingRefUpdate(Repository db, string localName, string remoteName, bool forceUpdate, AnyObjectId nv, string msg)
 {
     RemoteName = remoteName;
     update = db.UpdateRef(localName);
     update.IsForceUpdate = forceUpdate;
     update.NewObjectId = nv.Copy();
     update.SetRefLogMessage(msg, true);
 }
开发者ID:ArildF,项目名称:GitSharp,代码行数:8,代码来源:TrackingRefUpdate.cs

示例4: ObjectId

 public ObjectId(AnyObjectId src)
 {
     this.W1 = src.W1;
     this.W2 = src.W2;
     this.W3 = src.W3;
     this.W4 = src.W4;
     this.W5 = src.W5;
 }
开发者ID:ArildF,项目名称:GitSharp,代码行数:8,代码来源:ObjectId.cs

示例5: SetBase

	    /**
	     * Set the common ancestor tree.
	     *
	     * @param id
	     *            common base treeish; null to automatically compute the common
	     *            base from the input commits during
	     *            {@link #merge(AnyObjectId, AnyObjectId)}.
	     * @throws IncorrectObjectTypeException
	     *             the object is not a treeish.
	     * @throws MissingObjectException
	     *             the object does not exist.
	     * @throws IOException
	     *             the object could not be read.
	     */
	    public void SetBase(AnyObjectId id)
        {
		    if (id != null) 
            {
			    _baseTree = Walk.parseTree(id);
		    } 
            else 
            {
			    _baseTree = null;
		    }
	    }
开发者ID:gilran,项目名称:GitSharp,代码行数:25,代码来源:ThreeWayMerger.cs

示例6: Entry

		private static byte[] Entry(FileMode mode, string name, AnyObjectId id)
		{
			var @out = new MemoryStream();
			mode.CopyTo(@out);
			@out.WriteByte((byte) ' ');
			byte[] bytes = Constants.encode(name);
			@out.Write(bytes, 0, bytes.Length);
			@out.WriteByte(0);
			id.copyRawTo(@out);
			return @out.ToArray();
		}
开发者ID:dev218,项目名称:GitSharp,代码行数:11,代码来源:CanonicalTreeParserTest.cs

示例7: TrackingRefUpdate

 public TrackingRefUpdate(Repository db, string localName, string remoteName, bool forceUpdate, AnyObjectId nv, string msg)
 {
     if (db == null)
         throw new System.ArgumentNullException("db");
     if (nv == null)
         throw new System.ArgumentNullException("nv");
     RemoteName = remoteName;
     update = db.UpdateRef(localName);
     update.IsForceUpdate = forceUpdate;
     update.NewObjectId = nv.Copy();
     update.setRefLogMessage(msg, true);
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:12,代码来源:TrackingRefUpdate.cs

示例8: BinarySearchLevelTwo

        private int BinarySearchLevelTwo(AnyObjectId objId, int levelOne)
        {
            int[] data = _names[levelOne];
            var high = (int)((uint)(_offset32[levelOne].Length) >> 2);
            if (high == 0)
            {
                return -1;
            }

            int low = 0;
            do
            {
                var mid = (int)((uint)(low + high) >> 1);
                int mid4 = mid << 2;

                int cmp = objId.CompareTo(data, mid4 + mid);
                if (cmp < 0)
                {
                    high = mid;
                }
                else if (cmp == 0)
                {
                    return mid;
                }
                else
                {
                    low = mid + 1;
                }

            } while (low < high);
            return -1;
        }
开发者ID:nestalk,项目名称:GitSharp,代码行数:32,代码来源:PackIndexV2.cs

示例9: decodeTypeString

        /// <summary>
        /// Parse an encoded type string into a type constant.
        /// </summary>
        /// <param name="id">
        /// <see cref="ObjectId" /> this type string came from; may be null if 
        /// that is not known at the time the parse is occurring.
        /// </param>
        /// <param name="typeString">string version of the type code.</param>
        /// <param name="endMark">
        /// Character immediately following the type string. Usually ' '
        /// (space) or '\n' (line feed).
        /// </param>
        /// <param name="offset">
        /// Position within <paramref name="typeString"/> where the parse
        /// should start. Updated with the new position (just past
        /// <paramref name="endMark"/> when the parse is successful).
        /// </param>
        /// <returns>
        /// A type code constant (one of <see cref="OBJ_BLOB"/>,
        /// <see cref="OBJ_COMMIT"/>, <see cref="OBJ_TAG"/>, <see cref="OBJ_TREE"/>
        /// </returns>
        /// <exception cref="CorruptObjectException"></exception>
        public static int decodeTypeString(AnyObjectId id, byte[] typeString, byte endMark, MutableInteger offset)
        {
            try
            {
                int position = offset.value;
                switch (typeString[position])
                {
                    case (byte)'b':
                        if (typeString[position + 1] != (byte)'l'
                            || typeString[position + 2] != (byte)'o'
                            || typeString[position + 3] != (byte)'b'
                            || typeString[position + 4] != endMark)
                        {
                            throw new CorruptObjectException(id, "invalid type");
                        }
                        offset.value = position + 5;
                        return OBJ_BLOB;

                    case (byte)'c':
                        if (typeString[position + 1] != (byte)'o'
                                || typeString[position + 2] != (byte)'m'
                                || typeString[position + 3] != (byte)'m'
                                || typeString[position + 4] != (byte)'i'
                                || typeString[position + 5] != (byte)'t'
                                || typeString[position + 6] != endMark)
                        {
                            throw new CorruptObjectException(id, "invalid type");
                        }
                        offset.value = position + 7;
                        return OBJ_COMMIT;

                    case (byte)'t':
                        switch (typeString[position + 1])
                        {
                            case (byte)'a':
                                if (typeString[position + 2] != (byte)'g'
                                    || typeString[position + 3] != endMark)
                                    throw new CorruptObjectException(id, "invalid type");
                                offset.value = position + 4;
                                return OBJ_TAG;

                            case (byte)'r':
                                if (typeString[position + 2] != (byte)'e'
                                        || typeString[position + 3] != (byte)'e'
                                        || typeString[position + 4] != endMark)
                                    throw new CorruptObjectException(id, "invalid type");
                                offset.value = position + 5;
                                return OBJ_TREE;

                            default:
                                throw new CorruptObjectException(id, "invalid type");
                        }

                    default:
                        throw new CorruptObjectException(id, "invalid type");
                }
            }
            catch (IndexOutOfRangeException)
            {
                throw new CorruptObjectException(id, "invalid type");
            }
        }
开发者ID:dev218,项目名称:GitSharp,代码行数:84,代码来源:Constants.cs

示例10: FindCRC32

        public override long FindCRC32(AnyObjectId objId)
        {
            int levelOne = objId.GetFirstByte();
            int levelTwo = BinarySearchLevelTwo(objId, levelOne);
            if (levelTwo == -1)
            {
                throw new MissingObjectException(objId.Copy(), ObjectType.Unknown);
            }

            return NB.DecodeUInt32(_crc32[levelOne], levelTwo << 2);
        }
开发者ID:nestalk,项目名称:GitSharp,代码行数:11,代码来源:PackIndexV2.cs

示例11: FindOffset

        public override long FindOffset(AnyObjectId objId)
        {
            int levelOne = objId.GetFirstByte();
            int levelTwo = BinarySearchLevelTwo(objId, levelOne);
            if (levelTwo == -1)
            {
                return -1;
            }

            long p = NB.DecodeUInt32(_offset32[levelOne], levelTwo << 2);
            if ((p & IS_O64) != 0)
            {
                return NB.DecodeUInt64(_offset64, (8 * (int)(p & ~IS_O64)));
            }

            return p;
        }
开发者ID:nestalk,项目名称:GitSharp,代码行数:17,代码来源:PackIndexV2.cs

示例12: writeLooseRef

 private void writeLooseRef(string name, AnyObjectId id)
 {
     writeLooseRef(name, id.Name + "\n");
 }
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:4,代码来源:RefDirectoryTest.cs

示例13: writePackedRef

 private void writePackedRef(string name, AnyObjectId id)
 {
     writePackedRefs(id.Name + " " + name + "\n");
 }
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:4,代码来源:RefDirectoryTest.cs

示例14: CanonicalTreeParser

 /**
  * Create a new parser for a tree appearing in a subset of a repository.
  *
  * @param prefix
  *            position of this iterator in the repository tree. The value
  *            may be null or the empty array to indicate the prefix is the
  *            root of the repository. A trailing slash ('/') is
  *            automatically appended if the prefix does not end in '/'.
  * @param repo
  *            repository to load the tree data from.
  * @param treeId
  *            identity of the tree being parsed; used only in exception
  *            messages if data corruption is found.
  * @param curs
  *            a window cursor to use during data access from the repository.
  * @throws MissingObjectException
  *             the object supplied is not available from the repository.
  * @throws IncorrectObjectTypeException
  *             the object supplied as an argument is not actually a tree and
  *             cannot be parsed as though it were a tree.
  * @throws IOException
  *             a loose object or pack file could not be read.
  */
 public CanonicalTreeParser(byte[] prefix, Repository repo, AnyObjectId treeId, WindowCursor curs)
     : base(prefix)
 {
     reset(repo, treeId, curs);
 }
开发者ID:ArildF,项目名称:GitSharp,代码行数:28,代码来源:CanonicalTreeParser.cs

示例15: openObject

 /**
  * @param curs
  *            temporary working space associated with the calling thread.
  * @param id
  *            SHA-1 of an object.
  * 
  * @return a {@link ObjectLoader} for accessing the data of the named
  *         object, or null if the object does not exist.
  * @
  */
 public ObjectLoader openObject(WindowCursor curs, AnyObjectId id)
 {
     return objectDatabase.openObject(curs, id);
 }
开发者ID:gilran,项目名称:GitSharp,代码行数:14,代码来源:Repository.cs


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