From d69213006dc099613031e06f4eb20137aba60c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=BA=86=E4=BF=AD?= Date: Mon, 27 May 2024 17:18:45 +0800 Subject: [PATCH] Fix the issue of failed protection branch settings, such as non-existent branches or incorrect operation levels for pushes. --- .../Models/Branches/Requests/ProtectBranchRequest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/GitLabApiClient/Models/Branches/Requests/ProtectBranchRequest.cs b/src/GitLabApiClient/Models/Branches/Requests/ProtectBranchRequest.cs index e9ea51e5..54488839 100644 --- a/src/GitLabApiClient/Models/Branches/Requests/ProtectBranchRequest.cs +++ b/src/GitLabApiClient/Models/Branches/Requests/ProtectBranchRequest.cs @@ -25,9 +25,10 @@ public ProtectBranchRequest( { Guard.NotEmpty(name, nameof(name)); - PushAccessLevel = pushAccessLevel.ToString(); - MergeAccessLevel = mergeAccessLevel.ToString(); - UnprotectAccessLevel = unprotectAccessLevel.ToString(); + Name = name; + PushAccessLevel = ((int)pushAccessLevel).ToString(); + MergeAccessLevel = ((int)mergeAccessLevel).ToString(); + UnprotectAccessLevel = ((int)unprotectAccessLevel).ToString(); } ///