filter-branch: reset $GIT_* before cleaning up

This is pure code motion to enable a subsequent patch to add code which needs to happen with the reset $GIT_* but before the temporary directory has been cleaned up. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ian Campbell committed Sep 21, 2017 at 08:49 UTC d24813c460bb9db90ebcc5358bde03e20fc33654
1 file changed +5 -5
git-filter-branch.sh
+5 -5
@@ -544,11 +544,6 @@ if [ "$filter_tag_name" ]; then
544 done
545 fi
546
547 -cd "$orig_dir"
548 -rm -rf "$tempdir"
549 -
550 -trap - 0
551 -
547 unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
548 test -z "$ORIG_GIT_DIR" || {
549 GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR
@@ -562,6 +557,11 @@ test -z "$ORIG_GIT_INDEX_FILE" || {
557 export GIT_INDEX_FILE
558 }
559
560 +cd "$orig_dir"
561 +rm -rf "$tempdir"
562 +
563 +trap - 0
564 +
565 if [ "$(is_bare_repository)" = false ]; then
566 git read-tree -u -m HEAD || exit
567 fi