summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorIan Campbell <ijc@hellion.org.uk>2017-09-21 07:49:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-09-22 03:57:40 (GMT)
commitd24813c460bb9db90ebcc5358bde03e20fc33654 (patch)
treeda2291b1e9b8b8c73e8a48ba298bb278d5094914 /git-filter-branch.sh
parent94c9fd268d4287f6fbfef84793288479905a7e48 (diff)
downloadgit-d24813c460bb9db90ebcc5358bde03e20fc33654.zip
git-d24813c460bb9db90ebcc5358bde03e20fc33654.tar.gz
git-d24813c460bb9db90ebcc5358bde03e20fc33654.tar.bz2
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>
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 3a74602..3da281f 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -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