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


C# Repository.Create方法代码示例

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


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

示例1: createNewEmptyRepo

 /**
  * Helper for creating extra empty repos
  *
  * @return a new empty git repository for testing purposes
  *
  * @throws IOException
  */
 protected Repository createNewEmptyRepo()
 {
     var newTestRepo = new DirectoryInfo(trashParent + "/new" + DateTime.Now.Ticks + "." + (testcount++) + "/.git");
     Assert.IsFalse(newTestRepo.Exists);
     var newRepo = new Repository(newTestRepo);
     newRepo.Create();
     string name = GetType().Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name;
     repositoriesToClose.Add(newRepo);
     return newRepo;
 }
开发者ID:ArildF,项目名称:GitSharp,代码行数:17,代码来源:RepositoryTestCase.cs

示例2: setUp

        public virtual void setUp()
        {
            //super.setUp();
            configure();
            string name = GetType().Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name;
            recursiveDelete(trashParent, true, name, false); // Cleanup old failed stuff
            trash = new DirectoryInfo(trashParent + "/trash" + DateTime.Now.Ticks + "." + (testcount++));
            trash_git = new DirectoryInfo(trash + "/.git");

            var userGitConfigFile = new FileInfo(trash_git + "/usergitconfig").FullName;
            var userGitConfig = new RepositoryConfig(null, new FileInfo(userGitConfigFile));
            fakeSystemReader.setUserGitConfig(userGitConfig);

            db = new Repository(trash_git);
            db.Create();

            string[] packs = {
                "pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f",
                "pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371",
                "pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745",
                "pack-546ff360fe3488adb20860ce3436a2d6373d2796",
                "pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa",
                "pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12"
            };
            DirectoryInfo packDir = new DirectoryInfo(db.ObjectsDirectory + "/pack");

            foreach (var packname in packs)
            {
                new FileInfo("Resources/" + packname + ".pack").CopyTo(packDir + "/" + packname + ".pack", true);
                new FileInfo("Resources/" + packname + ".idx").CopyTo(packDir + "/" + packname + ".idx", true);
            }

            new FileInfo("Resources/packed-refs").CopyTo(trash_git.FullName + "/packed-refs", true);

            fakeSystemReader.values.Clear();
            fakeSystemReader.values[Constants.OS_USER_NAME_KEY] = Constants.OS_USER_NAME_KEY;
            fakeSystemReader.values[Constants.GIT_AUTHOR_NAME_KEY] = Constants.GIT_AUTHOR_NAME_KEY;
            fakeSystemReader.values[Constants.GIT_AUTHOR_EMAIL_KEY] = Constants.GIT_AUTHOR_EMAIL_KEY;
            fakeSystemReader.values[Constants.GIT_COMMITTER_NAME_KEY] = Constants.GIT_COMMITTER_NAME_KEY;
            fakeSystemReader.values[Constants.GIT_COMMITTER_EMAIL_KEY] = Constants.GIT_COMMITTER_EMAIL_KEY;
        }
开发者ID:ArildF,项目名称:GitSharp,代码行数:41,代码来源:RepositoryTestCase.cs


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