From 2a525d26b4db64e97ed3e9659e41629310084bca Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Tue, 17 Nov 2020 11:32:44 -0700
Subject: [PATCH] 51742.13.diff plus add a check for whether the site is under
 a VCS and display a separate "auto-updates are disabled" message for that
 case.

---
 src/wp-admin/update-core.php | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php
index 9068fedc78..cf64adcc08 100644
--- a/src/wp-admin/update-core.php
+++ b/src/wp-admin/update-core.php
@@ -62,7 +62,7 @@ function list_core_update( $update ) {
 	$show_buttons  = true;
 
 	if ( 'development' === $update->response ) {
-		$message = __( 'You are using a development version of WordPress. You can update to the latest nightly build manually:' );
+		$message = __( 'You can update to the latest nightly build manually:' );
 	} else {
 		if ( $current ) {
 			/* translators: %s: WordPress version. */
@@ -278,6 +278,7 @@ function core_upgrade_preamble() {
 		}
 	}
 
+	echo '<h2>' . __( 'You are using a development version of WordPress' ) . '</h2>';
 	echo '<ul class="core-updates">';
 	foreach ( (array) $updates as $update ) {
 		echo '<li>';
@@ -311,7 +312,7 @@ function core_auto_updates_settings() {
 			$notice_text = __( 'Automatic updates for all WordPress versions have been enabled. Thank you!' );
 			echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>';
 		} elseif ( 'disabled' === $_GET['core-major-auto-updates-saved'] ) {
-			$notice_text = __( 'WordPress will only receive automatic security and maintenance releases from now on.' );
+			$notice_text = __( 'WordPress will receive automatic security and maintenance releases from now on.' );
 			echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>';
 		}
 	}
@@ -395,24 +396,27 @@ function core_auto_updates_settings() {
 
 	<p class="auto-update-status">
 		<?php
-		if ( $upgrade_major ) {
+		$updater = new WP_Automatic_Updater();
+		if ( $updater->is_vcs_checkout( ABSPATH ) ) {
+			_e( 'The WordPress installation on this site appears to be under version control. Automatic updates are disabled.' );
+		} elseif ( $upgrade_major ) {
 			_e( 'This site is automatically kept up to date with each new version of WordPress.' );
 
 			if ( $can_set_update_option ) {
 				echo '<br>';
 				printf(
-					'<a href="%s">%s</a>',
+					'<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-disable">%s</a>',
 					wp_nonce_url( add_query_arg( 'value', 'disable', $action_url ), 'core-major-auto-updates-nonce' ),
 					__( 'Switch to automatic updates for maintenance and security releases only.' )
 				);
 			}
 		} elseif ( $upgrade_minor ) {
-			_e( 'This site is automatically kept up to date with maintenance and security releases of WordPress.' );
+			_e( 'This site is automatically kept up to date with maintenance and security releases of WordPress only.' );
 
 			if ( $can_set_update_option ) {
 				echo '<br>';
 				printf(
-					'<a href="%s">%s</a>',
+					'<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-enable">%s</a>',
 					wp_nonce_url( add_query_arg( 'value', 'enable', $action_url ), 'core-major-auto-updates-nonce' ),
 					__( 'Enable automatic updates for all new versions of WordPress.' )
 				);
-- 
2.28.0.windows.1

