@@ -950,9 +950,21 @@ fn log_branch_protection(
950
950
new : Option < & api:: BranchProtection > ,
951
951
mut result : impl Write ,
952
952
) -> std:: fmt:: Result {
953
+ let api:: BranchProtection {
954
+ // Pattern identifies the branch protection, so it has to be same between `current`
955
+ // and `new`.
956
+ pattern : _,
957
+ is_admin_enforced,
958
+ dismisses_stale_reviews,
959
+ required_approving_review_count,
960
+ required_status_check_contexts,
961
+ push_allowances,
962
+ requires_approving_reviews,
963
+ } = current;
964
+
953
965
macro_rules! log {
954
966
( $str: literal, $field1: ident) => {
955
- let old = & current . $field1;
967
+ let old = $field1;
956
968
let new = new. map( |n| & n. $field1) ;
957
969
log!( $str, old, new) ;
958
970
} ;
@@ -968,10 +980,12 @@ fn log_branch_protection(
968
980
}
969
981
970
982
log ! ( "Dismiss Stale Reviews" , dismisses_stale_reviews) ;
983
+ log ! ( "Is admin enforced" , is_admin_enforced) ;
971
984
log ! (
972
985
"Required Approving Review Count" ,
973
986
required_approving_review_count
974
987
) ;
988
+ log ! ( "Requires PR" , requires_approving_reviews) ;
975
989
log ! ( "Required Checks" , required_status_check_contexts) ;
976
990
log ! ( "Allowances" , push_allowances) ;
977
991
Ok ( ( ) )
0 commit comments