Bump to git 2.30.1
[platform/upstream/git.git] / git-difftool--helper.sh
index 7ef36b9..46af3e6 100755 (executable)
@@ -44,12 +44,13 @@ launch_merge_tool () {
                        "$GIT_DIFF_PATH_TOTAL" "$MERGED"
                if use_ext_cmd
                then
-                       printf "Launch '%s' [Y/n]: " \
+                       printf "Launch '%s' [Y/n]? " \
                                "$GIT_DIFFTOOL_EXTCMD"
                else
-                       printf "Launch '%s' [Y/n]: " "$merge_tool"
+                       printf "Launch '%s' [Y/n]? " "$merge_tool"
                fi
-               if read ans && test "$ans" = n
+               read ans || return
+               if test "$ans" = n
                then
                        return
                fi
@@ -70,7 +71,7 @@ then
        then
                merge_tool="$GIT_DIFF_TOOL"
        else
-               merge_tool="$(get_merge_tool)" || exit
+               merge_tool="$(get_merge_tool)"
        fi
 fi
 
@@ -84,6 +85,21 @@ else
        while test $# -gt 6
        do
                launch_merge_tool "$1" "$2" "$5"
+               status=$?
+               if test $status -ge 126
+               then
+                       # Command not found (127), not executable (126) or
+                       # exited via a signal (>= 128).
+                       exit $status
+               fi
+
+               if test "$status" != 0 &&
+                       test "$GIT_DIFFTOOL_TRUST_EXIT_CODE" = true
+               then
+                       exit $status
+               fi
                shift 7
        done
 fi
+
+exit 0