aboutsummaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-09-25 16:43:44 +0100
committerJunio C Hamano <gitster@pobox.com>2007-09-25 17:49:40 -0700
commitae830ed7f50377e64b774ce87441ff4538f04ad7 (patch)
tree56b2c2fa53c1e830fd2951207a07dd831e60b727 /git-rebase--interactive.sh
parentdad4e32c4658f12a6eaa2decead5d77678911d95 (diff)
downloadgit-ae830ed7f50377e64b774ce87441ff4538f04ad7.tar.gz
git-ae830ed7f50377e64b774ce87441ff4538f04ad7.tar.xz
rebase -i: avoid exporting GIT_AUTHOR_* variables
It is somewhat unsafe to export the GIT_AUTHOR_* variables, since a later call to git-commit or git-merge could pick them up inadvertently. So avoid the export, using a recipe provided by Johannes Sixt. Incidentally, this fixes authorship of merges with "rebase --preserve -i". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-xgit-rebase--interactive.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index efa83f613..d751984f8 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -174,7 +174,11 @@ pick_one_preserving_merges () {
eval "$author_script"
msg="$(git cat-file commit $sha1 | sed -e '1,/^$/d')"
# NEEDSWORK: give rerere a chance
- if ! output git merge $STRATEGY -m "$msg" $new_parents
+ if ! GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
+ GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
+ GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
+ output git merge $STRATEGY -m "$msg" \
+ $new_parents
then
printf "%s\n" "$msg" > "$GIT_DIR"/MERGE_MSG
die Error redoing merge $sha1
@@ -281,7 +285,9 @@ do_next () {
f)
# This is like --amend, but with a different message
eval "$author_script"
- export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
+ GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
+ GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
+ GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
$USE_OUTPUT git commit -F "$MSG" $EDIT_COMMIT
;;
t)