Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2015-01-07 22:32:39 +0300
committernulltoken <emeric.fermas@gmail.com>2015-01-07 22:32:39 +0300
commitee5393f2942bc447f2f5d5bcd55aa84f982f9e54 (patch)
treed0bf6f5c1ef73c90671c1c187f4d54dfb35c213a /LibGit2Sharp.Tests
parentd8189b15667683ecff049d792292fa0269c38c86 (diff)
Clarify branch tracking related tests
Related to #903
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r--LibGit2Sharp.Tests/BranchFixture.cs25
1 files changed, 16 insertions, 9 deletions
diff --git a/LibGit2Sharp.Tests/BranchFixture.cs b/LibGit2Sharp.Tests/BranchFixture.cs
index 03ea441a..c4ca927f 100644
--- a/LibGit2Sharp.Tests/BranchFixture.cs
+++ b/LibGit2Sharp.Tests/BranchFixture.cs
@@ -683,10 +683,12 @@ namespace LibGit2Sharp.Tests
string path = SandboxStandardTestRepo();
using (var repo = new Repository(path))
{
- Branch branch = repo.CreateBranch(testBranchName);
+ Branch trackedBranch = repo.Branches[trackedBranchName];
+ Assert.True(trackedBranch.IsRemote);
+
+ Branch branch = repo.CreateBranch(testBranchName, trackedBranch.Tip);
Assert.False(branch.IsTracking);
- Branch trackedBranch = repo.Branches[trackedBranchName];
repo.Branches.Update(branch,
b => b.TrackedBranch = trackedBranch.CanonicalName);
@@ -743,10 +745,12 @@ namespace LibGit2Sharp.Tests
string path = SandboxStandardTestRepo();
using (var repo = new Repository(path))
{
- Branch branch = repo.CreateBranch(testBranchName);
+ Branch trackedBranch = repo.Branches[trackedBranchName];
+ Assert.True(trackedBranch.IsRemote);
+
+ Branch branch = repo.CreateBranch(testBranchName, trackedBranch.Tip);
Assert.False(branch.IsTracking);
- Branch trackedBranch = repo.Branches[trackedBranchName];
Branch updatedBranch = repo.Branches.Update(branch,
b => b.Remote = remoteName,
b => b.UpstreamBranch = upstreamBranchName);
@@ -773,10 +777,11 @@ namespace LibGit2Sharp.Tests
string path = SandboxStandardTestRepo();
using (var repo = new Repository(path))
{
- Branch branch = repo.CreateBranch(testBranchName);
- Assert.False(branch.IsTracking);
-
Branch trackedBranch = repo.Branches[localTrackedBranchName];
+ Assert.False(trackedBranch.IsRemote);
+
+ Branch branch = repo.CreateBranch(testBranchName, trackedBranch.Tip);
+ Assert.False(branch.IsTracking);
repo.Branches.Update(branch,
b => b.TrackedBranch = trackedBranch.CanonicalName);
@@ -811,11 +816,13 @@ namespace LibGit2Sharp.Tests
string path = SandboxStandardTestRepo();
using (var repo = new Repository(path))
{
- Branch branch = repo.CreateBranch(testBranchName);
+ Branch trackedBranch = repo.Branches[trackedBranchName];
+
+ Branch branch = repo.CreateBranch(testBranchName, trackedBranch.Tip);
Assert.False(branch.IsTracking);
branch = repo.Branches.Update(branch,
- b => b.TrackedBranch = trackedBranchName);
+ b => b.TrackedBranch = trackedBranch.CanonicalName);
// Got the updated branch from the Update() method
Assert.True(branch.IsTracking);