]> granicus.if.org Git - git/commitdiff
filter-branch: reset $GIT_* before cleaning up
authorIan Campbell <ijc@hellion.org.uk>
Thu, 21 Sep 2017 07:49:29 +0000 (08:49 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Sep 2017 03:57:40 +0000 (12:57 +0900)
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>
git-filter-branch.sh

index 3a74602ef37712e16dc28567130ca8ee9e8fc579..3da281f8af4d288de12433d182f1d633198f63c6 100755 (executable)
@@ -544,11 +544,6 @@ if [ "$filter_tag_name" ]; then
        done
 fi
 
-cd "$orig_dir"
-rm -rf "$tempdir"
-
-trap - 0
-
 unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
 test -z "$ORIG_GIT_DIR" || {
        GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR
@@ -562,6 +557,11 @@ test -z "$ORIG_GIT_INDEX_FILE" || {
        export GIT_INDEX_FILE
 }
 
+cd "$orig_dir"
+rm -rf "$tempdir"
+
+trap - 0
+
 if [ "$(is_bare_repository)" = false ]; then
        git read-tree -u -m HEAD || exit
 fi