diff options
author | Saaman <romain.magny@gmail.com> | 2013-04-25 19:16:18 +0400 |
---|---|---|
committer | Saaman <romain.magny@gmail.com> | 2013-04-26 17:31:44 +0400 |
commit | 95430a1cb10344c174f19567dcf9c4c3f0023b8d (patch) | |
tree | 0fecfe5ca3d9e5f97a7875ccabbe2d33b7dbc5da /LibGit2Sharp.Tests/BranchFixture.cs | |
parent | 5960c38a21d1bd8e8f9cc26fb06ab9dc76a737b9 (diff) |
Teach UpdateTarget() to append to the reflog
Diffstat (limited to 'LibGit2Sharp.Tests/BranchFixture.cs')
-rw-r--r-- | LibGit2Sharp.Tests/BranchFixture.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/LibGit2Sharp.Tests/BranchFixture.cs b/LibGit2Sharp.Tests/BranchFixture.cs index 4a5e95ea..8208305d 100644 --- a/LibGit2Sharp.Tests/BranchFixture.cs +++ b/LibGit2Sharp.Tests/BranchFixture.cs @@ -382,7 +382,8 @@ namespace LibGit2Sharp.Tests using (var repo = new Repository(path)) { Branch master = repo.Branches["master"]; - repo.Refs.UpdateTarget("refs/remotes/origin/master", "origin/test"); + const string logMessage = "update target message"; + repo.Refs.UpdateTarget("refs/remotes/origin/master", "origin/test", logMessage); Assert.True(master.IsTracking); Assert.NotNull(master.TrackedBranch); @@ -391,6 +392,11 @@ namespace LibGit2Sharp.Tests Assert.Equal(9, master.TrackingDetails.AheadBy); Assert.Equal(2, master.TrackingDetails.BehindBy); Assert.Null(repo.Head.TrackingDetails.CommonAncestor); + + // Assert reflog entry is created + var reflogEntry = repo.Refs.Log("refs/remotes/origin/master").First(); + Assert.Equal(repo.Branches["origin/test"].Tip.Id, reflogEntry.To); + Assert.Equal(logMessage, reflogEntry.Message); } } |