mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 03:01:31 +00:00
add protected field to Branch
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user