Beispiel #1
0
        /// <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));
        }
Beispiel #2
0
		/// <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);
		}