aboutsummaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-28 16:18:43 -0700
committerJunio C Hamano <gitster@pobox.com>2010-06-28 16:18:43 -0700
commit339aec7acbd43f831ffc7dd193f53a34f918d4fb (patch)
tree8647a694cb47666039e5dd25a51af5d59818a6a2 /git-am.sh
parent6c1c4423e2f83037ef762d63be6edbc1f9e6e867 (diff)
parent43c23251f924db4188cf74361cb7cc3257accce3 (diff)
downloadgit-339aec7acbd43f831ffc7dd193f53a34f918d4fb.tar.gz
git-339aec7acbd43f831ffc7dd193f53a34f918d4fb.tar.xz
Merge branch 'js/maint-am-rebase-invalid-author' into maint
* js/maint-am-rebase-invalid-author: am: use get_author_ident_from_commit instead of mailinfo when rebasing
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/git-am.sh b/git-am.sh
index 87ffae252..1df5b0414 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -593,7 +593,7 @@ do
echo "Patch is empty. Was it split wrong?"
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") &&
@@ -602,6 +602,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"
@@ -613,9 +614,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