mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-07-17 05:51:18 +02:00
change temp email var to subshell
This commit is contained in:
parent
6f5a9d57ae
commit
77e96ce382
1 changed files with 5 additions and 9 deletions
|
|
@ -34,18 +34,14 @@ function work_in_progress() {
|
||||||
}
|
}
|
||||||
#change current branch old email with new eamil
|
#change current branch old email with new eamil
|
||||||
gmvemail() {
|
gmvemail() {
|
||||||
export GMVEMAIL_GIT_EMAIL_OLD=$1
|
OLD_EMAIL=$1 NEW_EMAIL=$2 git filter-branch --commit-filter '
|
||||||
export GMVEMAIL_GIT_EMAIL_NEW=$2
|
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ];
|
||||||
git filter-branch --commit-filter '
|
|
||||||
if [ "$GIT_AUTHOR_EMAIL" = "$GMVEMAIL_GIT_EMAIL_OLD" ];
|
|
||||||
then
|
then
|
||||||
GIT_AUTHOR_EMAIL="$GMVEMAIL_GIT_EMAIL_NEW";
|
GIT_AUTHOR_EMAIL="$NEW_EMAIL";
|
||||||
git commit-tree "$@";
|
git commit-tree "$@";
|
||||||
else
|
else
|
||||||
git commit-tree "$@";
|
git commit-tree "$@";
|
||||||
fi' HEAD
|
fi' HEAD
|
||||||
unset GMVEMAIL_GIT_EMAIL_OLD
|
|
||||||
unset GMVEMAIL_GIT_EMAIL_NEW
|
|
||||||
git update-ref -d refs/original/refs/heads/$(git symbolic-ref --short HEAD)
|
git update-ref -d refs/original/refs/heads/$(git symbolic-ref --short HEAD)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue