示例#1
0
        public void CanPullFromRemoteRepository()
        {
            var remotePath = CloneTestRepository(_fixture.PopulatedRepositoryPath);
            var localPath  = CloneTestRepository(remotePath);

            File.WriteAllLines(Path.Combine(remotePath, "new.txt"), new [] { "Hello", "World" });
            var remoteWrapper = new Git.GitWrapper(remotePath);
            var localWrapper  = new Git.GitWrapper(localPath);

            Assert.True(remoteWrapper.AddAll().Result.Success);
            Assert.True(remoteWrapper.Commit("Added a file").Result.Success);
            Assert.True(localWrapper.Pull().Result.Success);
            Assert.True(File.Exists(Path.Combine(localPath, "new.txt")));
        }