X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-am.sh;h=df09b42840b7675e135605f9108894ce93e6d477;hb=a7b60f00557002a37b1ea2e1922ac6ffbfc61fef;hp=ef2d51a2b80d77dc5fe28d76b5047a97dc4c0fae;hpb=f526d120f649ec4426b559e94e09655b5a4f2b87;p=git.git diff --git a/git-am.sh b/git-am.sh index ef2d51a2b..df09b4284 100755 --- a/git-am.sh +++ b/git-am.sh @@ -5,7 +5,7 @@ SUBDIRECTORY_OK=Yes OPTIONS_KEEPDASHDASH= OPTIONS_SPEC="\ -git am [options] [|...] +git am [options] [(|)...] git am [options] (--resolved | --skip | --abort) -- i,interactive run interactively @@ -137,7 +137,7 @@ It does not apply to blobs recorded in its index." export GITHEAD_$his_tree if test -n "$GIT_QUIET" then - export GIT_MERGE_VERBOSITY=0 + GIT_MERGE_VERBOSITY=0 && export GIT_MERGE_VERBOSITY fi git-merge-recursive $orig_tree -- HEAD $his_tree || { git rerere $allow_rerere_autoupdate @@ -444,12 +444,12 @@ else set x first= } - case "$arg" in - /*) - set "$@" "$arg" ;; - *) - set "$@" "$prefix$arg" ;; - esac + if is_absolute_path "$arg" + then + set "$@" "$arg" + else + set "$@" "$prefix$arg" + fi done shift fi @@ -596,7 +596,7 @@ do echo "To restore the original branch and stop patching run \"$cmdline --abort\"." stop_here $this } - rm -f "$dotest/original-commit" + rm -f "$dotest/original-commit" "$dotest/author-script" if test -f "$dotest/rebasing" && commit=$(sed -e 's/^From \([0-9a-f]*\) .*/\1/' \ -e q "$dotest/$msgnum") && @@ -605,6 +605,7 @@ do git cat-file commit "$commit" | sed -e '1,/^$/d' >"$dotest/msg-clean" echo "$commit" > "$dotest/original-commit" + get_author_ident_from_commit "$commit" > "$dotest/author-script" else { sed -n '/^Subject/ s/Subject: //p' "$dotest/info" @@ -616,9 +617,14 @@ do ;; esac - GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")" - GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")" - GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")" + if test -f "$dotest/author-script" + then + eval $(cat "$dotest/author-script") + else + GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")" + GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")" + GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")" + fi if test -z "$GIT_AUTHOR_EMAIL" then