git: 3d4424154617 - main - freebsd-update: allow user to break out of conflict resolution loop

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Wed, 18 Oct 2023 16:17:55 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=3d44241546173de00852ab5e22263ba538cd8759

commit 3d44241546173de00852ab5e22263ba538cd8759
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-03-03 17:32:51 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-10-18 16:17:33 +0000

    freebsd-update: allow user to break out of conflict resolution loop
    
    When a conflict marker is found during update allow the user to confirm
    they want it to remain in the file.
    
    Suggested by:   Tim Hogard
    Reviewed by:    imp
    Sponsored by:   The FreeBSD Foundation
    Fixes: ceb5f28ba5fc ("freebsd-update: re-edit files if merge confli...")
    Differential Revision: https://reviews.freebsd.org/D38896
---
 usr.sbin/freebsd-update/freebsd-update.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index 4866514c321e..551d40418240 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -2544,7 +2544,11 @@ Press Enter to edit this file in ${EDITOR} and resolve the conflicts
 manually...
 			EOF
 			while true; do
-				read dummy </dev/tty
+				read response </dev/tty
+				if expr "${response}" : '[Aa][Cc][Cc][Ee][Pp][Tt]' > /dev/null; then
+					echo
+					break
+				fi
 				${EDITOR} `pwd`/merge/new/${F} < /dev/tty
 
 				if ! grep -qE '^(<<<<<<<|=======|>>>>>>>)([[:space:]].*)?$' $(pwd)/merge/new/${F} ; then
@@ -2555,7 +2559,8 @@ manually...
 Merge conflict markers remain in: ${F}
 These must be resolved for the system to be functional.
 
-Press Enter to return to editing this file.
+Press Enter to return to editing this file, or type "ACCEPT" to carry on with
+these lines remaining in the file.
 				EOF
 			done
 		done < failed.merges