Skip to content

Commit e622f41

Browse files
jaysoffiangitster
authored andcommitted
git-mergetool: check return value from read
Mostly fixed already by 6b44577 (mergetool: check return value from read, 2011-07-01). Catch two uses it missed. Signed-off-by: Jay Soffian <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 740a8fc commit e622f41

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

git-mergetool--lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ check_unchanged () {
3838
while true; do
3939
echo "$MERGED seems unchanged."
4040
printf "Was the merge successful? [y/n] "
41-
read answer
41+
read answer || return 1
4242
case "$answer" in
4343
y*|Y*) status=0; break ;;
4444
n*|N*) status=1; break ;;

git-mergetool.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe_file () {
7272
resolve_symlink_merge () {
7373
while true; do
7474
printf "Use (l)ocal or (r)emote, or (a)bort? "
75-
read ans
75+
read ans || return 1
7676
case "$ans" in
7777
[lL]*)
7878
git checkout-index -f --stage=2 -- "$MERGED"

0 commit comments

Comments
 (0)