Skip to content

Conversation

@Not-Dhananjay-Mishra
Copy link
Contributor

Fixes : #2821

Added this check, similar to what we already have in GetBranchProtection

if isBranchNotProtected(err) {
	err = ErrBranchNotProtected
}

Now, when a branch is not protected, GetSignaturesProtectedBranch also returns ErrBranchNotProtected

Copy link
Contributor

@alexandear alexandear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a unit test.

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.44%. Comparing base (5dc0050) to head (e0b4cc6).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3896   +/-   ##
=======================================
  Coverage   92.44%   92.44%           
=======================================
  Files         203      203           
  Lines       14925    14927    +2     
=======================================
+ Hits        13797    13799    +2     
  Misses        926      926           
  Partials      202      202           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Not-Dhananjay-Mishra and @alexandear !
LGTM
Merging.

@gmlewis gmlewis merged commit 71bd14c into google:master Jan 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GetSignaturesProtectedBranch Does Not Return ErrBranchNotProtected When it Could

3 participants