mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
1.remove $BRANCH_NAME; 2.change email temp name to avoid wrongly changed env var
This commit is contained in:
parent
6a45c9e53b
commit
6f5a9d57ae
1 changed files with 7 additions and 8 deletions
|
|
@ -34,20 +34,19 @@ function work_in_progress() {
|
||||||
}
|
}
|
||||||
#change current branch old email with new eamil
|
#change current branch old email with new eamil
|
||||||
gmvemail() {
|
gmvemail() {
|
||||||
export OLD_GIT_EMAIL=$1
|
export GMVEMAIL_GIT_EMAIL_OLD=$1
|
||||||
export NEW_GIT_EMAIL=$2
|
export GMVEMAIL_GIT_EMAIL_NEW=$2
|
||||||
git filter-branch --commit-filter '
|
git filter-branch --commit-filter '
|
||||||
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_GIT_EMAIL" ];
|
if [ "$GIT_AUTHOR_EMAIL" = "$GMVEMAIL_GIT_EMAIL_OLD" ];
|
||||||
then
|
then
|
||||||
GIT_AUTHOR_EMAIL="$NEW_GIT_EMAIL";
|
GIT_AUTHOR_EMAIL="$GMVEMAIL_GIT_EMAIL_NEW";
|
||||||
git commit-tree "$@";
|
git commit-tree "$@";
|
||||||
else
|
else
|
||||||
git commit-tree "$@";
|
git commit-tree "$@";
|
||||||
fi' HEAD
|
fi' HEAD
|
||||||
unset OLD_GIT_EMAIL
|
unset GMVEMAIL_GIT_EMAIL_OLD
|
||||||
unset NEW_GIT_EMAIL
|
unset GMVEMAIL_GIT_EMAIL_NEW
|
||||||
BRANCH_NAME=$(git symbolic-ref --short HEAD)
|
git update-ref -d refs/original/refs/heads/$(git symbolic-ref --short HEAD)
|
||||||
git update-ref -d refs/original/refs/heads/${BRANCH_NAME}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue