add protected field to Branch

This commit is contained in:
Ryan Gribble
2016-08-08 23:35:32 +10:00
parent 2c7d6fbe42
commit 8a002b9704
+20 -2
View File
@@ -9,11 +9,24 @@ namespace Octokit
{
public Branch() { }
#pragma warning disable CS0618 // Type or member is obsolete
public Branch(string name, GitReference commit, BranchProtection protection)
public Branch(string name, GitReference commit, bool @protected)
{
Name = name;
Commit = commit;
Protected = @protected;
}
#pragma warning disable CS0618 // Type or member is obsolete
public Branch(string name, GitReference commit, BranchProtection protection)
: this(name, commit, protection, false)
{
}
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
public Branch(string name, GitReference commit, BranchProtection protection, bool @protected)
: this(name, commit, @protected)
{
Protection = protection;
}
#pragma warning restore CS0618 // Type or member is obsolete
@@ -30,6 +43,11 @@ namespace Octokit
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.", false)]
public BranchProtection Protection { get; protected set; }
/// <summary>
/// Whether this <see cref="Branch"/> is protected.
/// </summary>
public bool Protected { get; protected set; }
/// <summary>
/// The <see cref="GitReference"/> history for this <see cref="Branch"/>.
/// </summary>