@@ -114,7 +114,7 @@ func statusRun(opts *StatusOptions) error {
114114 currentPR = nil
115115 }
116116 if currentPR != nil {
117- printPrs (opts .IO , 1 , prPayload . StrictProtection , * currentPR )
117+ printPrs (opts .IO , 1 , * currentPR )
118118 } else if currentPRHeadRef == "" {
119119 shared .PrintMessage (opts .IO , " There is no current branch" )
120120 } else {
@@ -124,15 +124,15 @@ func statusRun(opts *StatusOptions) error {
124124
125125 shared .PrintHeader (opts .IO , "Created by you" )
126126 if prPayload .ViewerCreated .TotalCount > 0 {
127- printPrs (opts .IO , prPayload .ViewerCreated .TotalCount , prPayload .StrictProtection , prPayload . ViewerCreated .PullRequests ... )
127+ printPrs (opts .IO , prPayload .ViewerCreated .TotalCount , prPayload .ViewerCreated .PullRequests ... )
128128 } else {
129129 shared .PrintMessage (opts .IO , " You have no open pull requests" )
130130 }
131131 fmt .Fprintln (out )
132132
133133 shared .PrintHeader (opts .IO , "Requesting a code review from you" )
134134 if prPayload .ReviewRequested .TotalCount > 0 {
135- printPrs (opts .IO , prPayload .ReviewRequested .TotalCount , prPayload .StrictProtection , prPayload . ReviewRequested .PullRequests ... )
135+ printPrs (opts .IO , prPayload .ReviewRequested .TotalCount , prPayload .ReviewRequested .PullRequests ... )
136136 } else {
137137 shared .PrintMessage (opts .IO , " You have no pull requests to review" )
138138 }
@@ -178,7 +178,7 @@ func prSelectorForCurrentBranch(baseRepo ghrepo.Interface, prHeadRef string, rem
178178 return
179179}
180180
181- func printPrs (io * iostreams.IOStreams , totalCount int , strictProtection bool , prs ... api.PullRequest ) {
181+ func printPrs (io * iostreams.IOStreams , totalCount int , prs ... api.PullRequest ) {
182182 w := io .Out
183183 cs := io .ColorScheme ()
184184
@@ -228,15 +228,14 @@ func printPrs(io *iostreams.IOStreams, totalCount int, strictProtection bool, pr
228228 fmt .Fprint (w , cs .Green ("✓ Approved" ))
229229 }
230230
231- // only check if the "up to date" setting is checked in repo settings
232- if strictProtection {
233- // add padding between reviews & merge status
234- fmt .Fprint (w , " " )
235-
236- if pr .MergeStateStatus == "BEHIND" {
237- fmt .Fprint (w , cs .Yellow ("- Not up to date" ))
238- } else {
239- fmt .Fprint (w , cs .Green ("✓ Up to date" ))
231+ if pr .BaseRef .BranchProtectionRule .RequiresStrictStatusChecks {
232+ switch pr .MergeStateStatus {
233+ case "BEHIND" :
234+ fmt .Fprintf (w , " %s" , cs .Yellow ("- Not up to date" ))
235+ case "UNKNOWN" , "DIRTY" :
236+ // do not print anything
237+ default :
238+ fmt .Fprintf (w , " %s" , cs .Green ("✓ Up to date" ))
240239 }
241240 }
242241
0 commit comments