Code

gitweb: Lift any characters restriction on searched strings
[git.git] / git-am.sh
index d57a3e2d092c227344deee9596da04e0792f155c..6809aa07f60165855ebc0192750e85569f9685ff 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -2,8 +2,10 @@
 #
 # Copyright (c) 2005, 2006 Junio C Hamano
 
-USAGE='[--signoff] [--dotest=<dir>] [--utf8 | --no-utf8] [--binary] [--3way]
-  [--interactive] [--whitespace=<option>] [-C<n>] [-p<n>] <mbox>...
+USAGE='[--signoff] [--dotest=<dir>] [--keep] [--utf8 | --no-utf8]
+  [--3way] [--interactive] [--binary]
+  [--whitespace=<option>] [-C<n>] [-p<n>]
+  <mbox>|<Maildir>...
   or, when resuming [--skip | --resolved]'
 . git-sh-setup
 set_reflog_action am
@@ -95,10 +97,7 @@ It does not apply to blobs recorded in its index."
     eval GITHEAD_$his_tree='"$SUBJECT"'
     export GITHEAD_$his_tree
     git-merge-recursive $orig_tree -- HEAD $his_tree || {
-           if test -d "$GIT_DIR/rr-cache"
-           then
-               git rerere
-           fi
+           git rerere
            echo Failed to merge in the changes.
            exit 1
     }
@@ -106,7 +105,8 @@ It does not apply to blobs recorded in its index."
 }
 
 prec=4
-dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary= resolvemsg=
+dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary=
+resolvemsg= resume=
 git_apply_opt=
 
 while case "$#" in 0) break;; esac
@@ -252,10 +252,7 @@ last=`cat "$dotest/last"`
 this=`cat "$dotest/next"`
 if test "$skip" = t
 then
-       if test -d "$GIT_DIR/rr-cache"
-       then
-               git rerere clear
-       fi
+       git rerere clear
        this=`expr "$this" + 1`
        resume=
 fi
@@ -290,6 +287,12 @@ do
                git mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
                        <"$dotest/$msgnum" >"$dotest/info" ||
                        stop_here $this
+
+               # skip pine's internal folder data
+               grep '^Author: Mail System Internal Data$' \
+                       <"$dotest"/info >/dev/null &&
+                       go_next && continue
+
                test -s $dotest/patch || {
                        echo "Patch is empty.  Was it split wrong?"
                        stop_here $this
@@ -370,7 +373,7 @@ do
                [yY]*) action=yes ;;
                [aA]*) action=yes interactive= ;;
                [nN]*) action=skip ;;
-               [eE]*) "${VISUAL:-${EDITOR:-vi}}" "$dotest/final-commit"
+               [eE]*) git_editor "$dotest/final-commit"
                       action=again ;;
                [vV]*) action=again
                       LESS=-S ${PAGER:-less} "$dotest/patch" ;;
@@ -420,10 +423,7 @@ do
                        stop_here_user_resolve $this
                fi
                apply_status=0
-               if test -d "$GIT_DIR/rr-cache"
-               then
-                       git rerere
-               fi
+               git rerere
                ;;
        esac