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


C# Repository.NewObjectInserter方法代码示例

本文整理汇总了C#中Repository.NewObjectInserter方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.NewObjectInserter方法的具体用法?C# Repository.NewObjectInserter怎么用?C# Repository.NewObjectInserter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Repository的用法示例。


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

示例1: Add

		/// <exception cref="System.IO.FileNotFoundException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		internal static DirCacheEditor.PathEdit Add(Repository db, FilePath workdir, string
			 path)
		{
			ObjectInserter inserter = db.NewObjectInserter();
			FilePath f = new FilePath(workdir, path);
			ObjectId id = inserter.Insert(Constants.OBJ_BLOB, IOUtil.ReadFully(f));
			return new _PathEdit_81(f, id, path);
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:10,代码来源:IndexDiffTest.cs

示例2: WriteBlob

		/// <exception cref="System.IO.IOException"></exception>
		private RevObject WriteBlob(Repository repo, string data)
		{
			RevWalk revWalk = new RevWalk(repo);
			byte[] bytes = Constants.Encode(data);
			ObjectInserter inserter = repo.NewObjectInserter();
			ObjectId id;
			try
			{
				id = inserter.Insert(Constants.OBJ_BLOB, bytes);
				inserter.Flush();
			}
			finally
			{
				inserter.Release();
			}
			try
			{
				Parse(id);
				NUnit.Framework.Assert.Fail("Object " + id.Name + " should not exist in test repository"
					);
			}
			catch (MissingObjectException)
			{
			}
			// Ok
			return revWalk.LookupBlob(id);
		}
开发者ID:shoff,项目名称:ngit,代码行数:28,代码来源:ConcurrentRepackTest.cs

示例3: WriteTree

		/// <summary>Construct a WriteTree for a given directory</summary>
		/// <param name="sourceDirectory"></param>
		/// <param name="db"></param>
		public WriteTree(FilePath sourceDirectory, Repository db) : base(sourceDirectory)
		{
			inserter = db.NewObjectInserter();
		}
开发者ID:famousthom,项目名称:monodevelop,代码行数:7,代码来源:WriteTree.cs

示例4: WalkFetchConnection

		internal WalkFetchConnection(WalkTransport t, WalkRemoteObjectDatabase w)
		{
			NGit.Transport.Transport wt = (NGit.Transport.Transport)t;
			local = wt.local;
			objCheck = wt.IsCheckFetchedObjects() ? new ObjectChecker() : null;
			inserter = local.NewObjectInserter();
			reader = local.NewObjectReader();
			remotes = new AList<WalkRemoteObjectDatabase>();
			remotes.AddItem(w);
			unfetchedPacks = new List<WalkFetchConnection.RemotePack>();
			packsConsidered = new HashSet<string>();
			noPacksYet = new List<WalkRemoteObjectDatabase>();
			noPacksYet.AddItem(w);
			noAlternatesYet = new List<WalkRemoteObjectDatabase>();
			noAlternatesYet.AddItem(w);
			fetchErrors = new Dictionary<ObjectId, IList<Exception>>();
			packLocks = new AList<PackLock>(4);
			revWalk = new RevWalk(reader);
			revWalk.SetRetainBody(false);
			treeWalk = new TreeWalk(reader);
			COMPLETE = revWalk.NewFlag("COMPLETE");
			IN_WORK_QUEUE = revWalk.NewFlag("IN_WORK_QUEUE");
			LOCALLY_SEEN = revWalk.NewFlag("LOCALLY_SEEN");
			localCommitQueue = new DateRevQueue();
			workQueue = new List<ObjectId>();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:26,代码来源:WalkFetchConnection.cs

示例5: NoteMapMerger

		/// <summary>
		/// Constructs a NoteMapMerger with custom
		/// <see cref="NoteMerger">NoteMerger</see>
		/// and custom
		/// <see cref="NGit.Merge.MergeStrategy">NGit.Merge.MergeStrategy</see>
		/// .
		/// </summary>
		/// <param name="db">Git repository</param>
		/// <param name="noteMerger">note merger for merging conflicting changes on a note</param>
		/// <param name="nonNotesMergeStrategy">merge strategy for merging non-note entries</param>
		public NoteMapMerger(Repository db, NoteMerger noteMerger, MergeStrategy nonNotesMergeStrategy
			)
		{
			this.db = db;
			this.reader = db.NewObjectReader();
			this.inserter = db.NewObjectInserter();
			this.noteMerger = noteMerger;
			this.nonNotesMergeStrategy = nonNotesMergeStrategy;
			this.objectIdPrefix = new MutableObjectId();
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:20,代码来源:NoteMapMerger.cs


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