예제 #1
0
 /// <summary>Create submodule generator</summary>
 /// <param name="repository"></param>
 /// <exception cref="System.IO.IOException">System.IO.IOException</exception>
 public SubmoduleWalk(Repository repository)
 {
     this.repository = repository;
     repoConfig = repository.GetConfig();
     walk = new TreeWalk(repository);
     walk.Recursive = true;
 }
        /// <exception cref="System.Exception"></exception>
        public override void SetUp()
        {
            base.SetUp();
            util = new TestRepository <Repository>(db);
            StoredConfig config = util.GetRepository().GetConfig();

            config.SetString(ConfigConstants.CONFIG_BRANCH_SECTION, "master", ConfigConstants
                             .CONFIG_KEY_REMOTE, "origin");
            config.SetString(ConfigConstants.CONFIG_BRANCH_SECTION, "master", ConfigConstants
                             .CONFIG_KEY_MERGE, "refs/heads/master");
            config.SetString(ConfigConstants.CONFIG_REMOTE_SECTION, "origin", "fetch", "+refs/heads/*:refs/remotes/origin/*"
                             );
        }
예제 #3
0
 /// <summary>
 /// GitConfigの検査
 /// </summary>
 /// <param name="config">コンフィグクラス</param>
 /// <param name="func">コールバック関数</param>
 public static void CheckConfig(StoredConfig config, Func<string, string, string, bool> func)
 {
     foreach (string section in config.GetSections())
     {
         foreach (string name in config.GetNames(section))
         {
             if (func(section, string.Empty, name) == true)
             {
                 return;
             }
         }
         foreach (string subsection in config.GetSubsections(section))
         {
             foreach (string name in config.GetNames(section, subsection))
             {
                 if (func(section, string.Empty, name) == true)
                 {
                     return;
                 }
             }
         }
     }
 }
예제 #4
0
		internal RemoteSource (StoredConfig cfg, RemoteConfig rem)
		{
			this.cfg = cfg;
			RepoRemote = rem;
			Name = rem.Name;
			FetchUrl = rem.URIs.Select (u => u.ToString ()).FirstOrDefault ();
			PushUrl = rem.PushURIs.Select (u => u.ToString ()).FirstOrDefault ();
			if (string.IsNullOrEmpty (PushUrl))
				PushUrl = FetchUrl;
		}
예제 #5
0
		/// <summary>Reset generator and start new submodule walk</summary>
		/// <returns>this generator</returns>
		public virtual NGit.Submodule.SubmoduleWalk Reset()
		{
			repoConfig = repository.GetConfig();
			modulesConfig = null;
			walk.Reset();
			return this;
		}