Code

difftool--helper: Remove use of the GIT_MERGE_TOOL variable
[git.git] / git-am.sh
index 185ea23af63223f5b20fce983d2b7086c87c0957..4838cdb9ede8765b37ab663aa59fb1b011a30b4c 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -577,11 +577,12 @@ do
                        git cat-file commit "$commit" |
                        sed -e '1,/^$/d' >"$dotest/msg-clean"
                else
-                       SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
-                       case "$keep_subject" in -k)  SUBJECT="[PATCH] $SUBJECT" ;; esac
-
-                       (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") |
-                               git stripspace > "$dotest/msg-clean"
+                       {
+                               sed -n '/^Subject/ s/Subject: //p' "$dotest/info"
+                               echo
+                               cat "$dotest/msg"
+                       } |
+                       git stripspace > "$dotest/msg-clean"
                fi
                ;;
        esac
@@ -656,7 +657,10 @@ do
                [eE]*) git_editor "$dotest/final-commit"
                       action=again ;;
                [vV]*) action=again
-                      LESS=-S ${PAGER:-less} "$dotest/patch" ;;
+                      : ${GIT_PAGER=$(git var GIT_PAGER)}
+                      : ${LESS=-FRSX}
+                      export LESS
+                      $GIT_PAGER "$dotest/patch" ;;
                *)     action=again ;;
                esac
            done