public override void Setup ()
		{
			// Generate directories and a svn util.
			rootUrl = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
			rootCheckout = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
			Directory.CreateDirectory (rootUrl.FullPath + "repo.git");
			repoLocation = "file:///" + rootUrl.FullPath + "repo.git";

			// Initialize the bare repo.
			InitCommand ci = new InitCommand ();
			ci.SetDirectory (new Sharpen.FilePath (rootUrl.FullPath + "repo.git"));
			ci.SetBare (true);
			ci.Call ();
			FileRepository bare = new FileRepository (new Sharpen.FilePath (rootUrl.FullPath + "repo.git"));
			string branch = Constants.R_HEADS + "master";

			RefUpdate head = bare.UpdateRef (Constants.HEAD);
			head.DisableRefLog ();
			head.Link (branch);

			// Check out the repository.
			Checkout (rootCheckout, repoLocation);
			repo = GetRepo (rootCheckout, repoLocation);
			DOT_DIR = ".git";
		}
Beispiel #2
0
        public override void Setup()
        {
            // Generate directories and a svn util.
            rootUrl      = new FilePath(FileService.CreateTempDirectory() + Path.DirectorySeparatorChar);
            rootCheckout = new FilePath(FileService.CreateTempDirectory() + Path.DirectorySeparatorChar);
            Directory.CreateDirectory(rootUrl.FullPath + "repo.git");
            repoLocation = "file:///" + rootUrl.FullPath + "repo.git";

            // Initialize the bare repo.
            InitCommand ci = new InitCommand();

            ci.SetDirectory(new Sharpen.FilePath(rootUrl.FullPath + "repo.git"));
            ci.SetBare(true);
            ci.Call();
            FileRepository bare   = new FileRepository(new Sharpen.FilePath(rootUrl.FullPath + "repo.git"));
            string         branch = Constants.R_HEADS + "master";

            RefUpdate head = bare.UpdateRef(Constants.HEAD);

            head.DisableRefLog();
            head.Link(branch);

            // Check out the repository.
            Checkout(rootCheckout, repoLocation);
            repo    = GetRepo(rootCheckout, repoLocation);
            DOT_DIR = ".git";
        }
        public override void Setup()
        {
            // Generate directories and a svn util.
            RemotePath = new FilePath(FileService.CreateTempDirectory() + Path.DirectorySeparatorChar);
            LocalPath  = new FilePath(FileService.CreateTempDirectory() + Path.DirectorySeparatorChar);
            Directory.CreateDirectory(RemotePath.FullPath + "repo.git");
            RemoteUrl = "file:///" + RemotePath.FullPath + "repo.git";

            // Initialize the bare repo.
            var ci = new InitCommand();

            ci.SetDirectory(new Sharpen.FilePath(RemotePath.FullPath + "repo.git"));
            ci.SetBare(true);
            ci.Call();
            var    bare   = new FileRepository(new Sharpen.FilePath(RemotePath.FullPath + "repo.git"));
            string branch = Constants.R_HEADS + "master";

            RefUpdate head = bare.UpdateRef(Constants.HEAD);

            head.DisableRefLog();
            head.Link(branch);

            // Check out the repository.
            Checkout(LocalPath, RemoteUrl);
            Repo   = GetRepo(LocalPath, RemoteUrl);
            DotDir = ".git";
        }
		public override void Setup ()
		{
			// Generate directories and a svn util.
			RemotePath = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
			LocalPath = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
			Directory.CreateDirectory (RemotePath.FullPath + "repo.git");
			RemoteUrl = "file:///" + RemotePath.FullPath + "repo.git";

			// Initialize the bare repo.
			var ci = new InitCommand ();
			ci.SetDirectory (new Sharpen.FilePath (RemotePath.FullPath + "repo.git"));
			ci.SetBare (true);
			ci.Call ();
			var bare = new FileRepository (new Sharpen.FilePath (RemotePath.FullPath + "repo.git"));
			string branch = Constants.R_HEADS + "master";

			RefUpdate head = bare.UpdateRef (Constants.HEAD);
			head.DisableRefLog ();
			head.Link (branch);

			// Check out the repository.
			Checkout (LocalPath, RemoteUrl);
			Repo = GetRepo (LocalPath, RemoteUrl);
			DotDir = ".git";
		}
Beispiel #5
0
 public virtual void TestInitBareRepository()
 {
     FilePath directory = CreateTempDirectory("testInitBareRepository");
     InitCommand command = new InitCommand();
     command.SetDirectory(directory);
     command.SetBare(true);
     Repository repository = command.Call().GetRepository();
     AddRepoToClose(repository);
     NUnit.Framework.Assert.IsNotNull(repository);
     NUnit.Framework.Assert.IsTrue(repository.IsBare);
 }