public void RemotePushPull() { string n1 = @"GitStore\N1"; RepoTests.CleanPath(n1); string n2 = @"GitStore\N2"; RepoTests.CleanPath(n2); using (var r1 = new Repo(n1, new RepoOptions() { RemoteName = "origin", RemoteUrl = n2 })) using (var r2 = new Repo(n2, new RepoOptions() { RemoteName = "origin", RemoteUrl = n1 })) { r1.Save("A", "Rabbit"); r1.Push(); r2.Pull(); var r = r2.Get("A").Content; Assert.That(r, Is.EqualTo("Rabbit")); //p2 r2.Save("B", "Rat"); r2.Push(); r1.Pull(); Assert.That(r1.Get("B").Content, Is.EqualTo("Rat")); } }
public void RemoteMergeConflictResolve() { string n1 = @"GitStore\N1"; RepoTests.CleanPath(n1); string n2 = @"GitStore\N2"; RepoTests.CleanPath(n2); using (var r1 = new Repo(n1, new RepoOptions() { RemoteName = "origin", RemoteUrl = n2 })) using (var r2 = new Repo(n2, new RepoOptions() { RemoteName = "origin", RemoteUrl = n1 })) { r1.Save("A", @" { a:1 }"); r1.Push(); r2.Pull(); r1.Save("A", @" { a:1, b:1 }"); r2.Save("A", @" { a:1, b:2 }"); r2.Push(); r1.Pull(); r1.Push(); Assert.AreEqual(r1.Get("A").Content, r2.Get("A").Content); Assert.That(r1.Get("A").Content, Is.EqualTo(@" { a:1, b:2 }")); } }