Skip to content

Commit 450fb1b

Browse files
committed
Convert Reference.IsLocalBranch() into a property
1 parent 2b2d0f3 commit 450fb1b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

LibGit2Sharp.Tests/ReferenceFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ public void CanIdentifyReferenceKind()
829829
string path = SandboxStandardTestRepo();
830830
using (var repo = new Repository(path))
831831
{
832-
Assert.True(repo.Refs["refs/heads/master"].IsLocalBranch());
832+
Assert.True(repo.Refs["refs/heads/master"].IsLocalBranch);
833833
Assert.True(repo.Refs["refs/remotes/origin/master"].IsRemoteTrackingBranch());
834834
Assert.True(repo.Refs["refs/tags/lw"].IsTag());
835835
}

LibGit2Sharp/Reference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public static bool IsValidName(string canonicalName)
8787
/// Determine if the current <see cref="Reference"/> is a local branch.
8888
/// </summary>
8989
/// <returns>true if the current <see cref="Reference"/> is a local branch, false otherwise.</returns>
90-
public virtual bool IsLocalBranch()
90+
public virtual bool IsLocalBranch
9191
{
92-
return CanonicalName.LooksLikeLocalBranch();
92+
get { return CanonicalName.LooksLikeLocalBranch(); }
9393
}
9494

9595
/// <summary>

LibGit2Sharp/ReferenceCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public virtual Reference Rename(Reference reference, string newName, string logM
214214
if (logMessage == null)
215215
{
216216
logMessage = string.Format(CultureInfo.InvariantCulture, "{0}: renamed {1} to {2}",
217-
reference.IsLocalBranch() ? "branch" : "reference", reference.CanonicalName, newName);
217+
reference.IsLocalBranch ? "branch" : "reference", reference.CanonicalName, newName);
218218
}
219219

220220
using (ReferenceSafeHandle referencePtr = RetrieveReferencePtr(reference.CanonicalName))

LibGit2Sharp/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ public Branch Checkout(string committishOrBranchSpec, CheckoutOptions options)
851851
if (!refH.IsInvalid)
852852
{
853853
var reference = Reference.BuildFromPtr<Reference>(refH, this);
854-
if (reference.IsLocalBranch())
854+
if (reference.IsLocalBranch)
855855
{
856856
Branch branch = Branches[reference.CanonicalName];
857857
return Checkout(branch, options);

0 commit comments

Comments
 (0)