@@ -114,7 +114,7 @@ func statusRun(opts *StatusOptions) error {
114114 currentPR = nil
115115 }
116116 if currentPR != nil {
117- printPrs (opts .IO , 1 , * currentPR )
117+ printPrs (opts .IO , 1 , prPayload . StrictProtection , * 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 .ViewerCreated .PullRequests ... )
127+ printPrs (opts .IO , prPayload .ViewerCreated .TotalCount , prPayload .StrictProtection , 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 .ReviewRequested .PullRequests ... )
135+ printPrs (opts .IO , prPayload .ReviewRequested .TotalCount , prPayload .StrictProtection , 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 , prs ... api.PullRequest ) {
181+ func printPrs (io * iostreams.IOStreams , totalCount int , strictProtection bool , prs ... api.PullRequest ) {
182182 w := io .Out
183183 cs := io .ColorScheme ()
184184
@@ -228,13 +228,16 @@ func printPrs(io *iostreams.IOStreams, totalCount int, prs ...api.PullRequest) {
228228 fmt .Fprint (w , cs .Green ("✓ Approved" ))
229229 }
230230
231- // add padding between reviews & merge status
232- fmt .Fprint (w , " " )
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 , " " )
233235
234- if pr .MergeStateStatus == "BEHIND" {
235- fmt .Fprint (w , cs .Yellow ("- Not up to date" ))
236- } else {
237- fmt .Fprint (w , cs .Green ("✓ Up to date" ))
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" ))
240+ }
238241 }
239242
240243 } else {
0 commit comments