Commit 7b1378bd authored by Ian Campbell's avatar Ian Campbell Committed by Junio C Hamano

filter-branch: preserve and restore $GIT_AUTHOR_* and $GIT_COMMITTER_*

These are modified by set_ident() but a subsequent patch would like to operate
on their original values.
Signed-off-by: Ian Campbell's avatarIan Campbell <ijc@hellion.org.uk>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent d24813c4
......@@ -219,6 +219,13 @@ trap 'cd "$orig_dir"; rm -rf "$tempdir"' 0
ORIG_GIT_DIR="$GIT_DIR"
ORIG_GIT_WORK_TREE="$GIT_WORK_TREE"
ORIG_GIT_INDEX_FILE="$GIT_INDEX_FILE"
ORIG_GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME"
ORIG_GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL"
ORIG_GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE"
ORIG_GIT_COMMITTER_NAME="$GIT_COMMITTER_NAME"
ORIG_GIT_COMMITTER_EMAIL="$GIT_COMMITTER_EMAIL"
ORIG_GIT_COMMITTER_DATE="$GIT_COMMITTER_DATE"
GIT_WORK_TREE=.
export GIT_DIR GIT_WORK_TREE
......@@ -545,6 +552,8 @@ if [ "$filter_tag_name" ]; then
fi
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE
test -z "$ORIG_GIT_DIR" || {
GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR
}
......@@ -556,6 +565,30 @@ test -z "$ORIG_GIT_INDEX_FILE" || {
GIT_INDEX_FILE="$ORIG_GIT_INDEX_FILE" &&
export GIT_INDEX_FILE
}
test -z "$ORIG_GIT_AUTHOR_NAME" || {
GIT_AUTHOR_NAME="$ORIG_GIT_AUTHOR_NAME" &&
export GIT_AUTHOR_NAME
}
test -z "$ORIG_GIT_AUTHOR_EMAIL" || {
GIT_AUTHOR_EMAIL="$ORIG_GIT_AUTHOR_EMAIL" &&
export GIT_AUTHOR_EMAIL
}
test -z "$ORIG_GIT_AUTHOR_DATE" || {
GIT_AUTHOR_DATE="$ORIG_GIT_AUTHOR_DATE" &&
export GIT_AUTHOR_DATE
}
test -z "$ORIG_GIT_COMMITTER_NAME" || {
GIT_COMMITTER_NAME="$ORIG_GIT_COMMITTER_NAME" &&
export GIT_COMMITTER_NAME
}
test -z "$ORIG_GIT_COMMITTER_EMAIL" || {
GIT_COMMITTER_EMAIL="$ORIG_GIT_COMMITTER_EMAIL" &&
export GIT_COMMITTER_EMAIL
}
test -z "$ORIG_GIT_COMMITTER_DATE" || {
GIT_COMMITTER_DATE="$ORIG_GIT_COMMITTER_DATE" &&
export GIT_COMMITTER_DATE
}
cd "$orig_dir"
rm -rf "$tempdir"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment