summaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-27 19:07:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-27 19:07:44 (GMT)
commitbcdfb20ae94138eac863b4c40263dc10f29917e5 (patch)
tree16ac75f5d25be56dfb28fe481d03b5526791680b /git-am.sh
parent4af574dbdc543b43e16838ed69890470b763136d (diff)
parent43c23251f924db4188cf74361cb7cc3257accce3 (diff)
downloadgit-bcdfb20ae94138eac863b4c40263dc10f29917e5.zip
git-bcdfb20ae94138eac863b4c40263dc10f29917e5.tar.gz
git-bcdfb20ae94138eac863b4c40263dc10f29917e5.tar.bz2
Merge branch 'js/maint-am-rebase-invalid-author'
* 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 ef2d51a..e7f008c 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -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