git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 1/4] filter-branch: reset $GIT_* before cleaning up

From
Ian Campbell <ijc@hellion.org.uk>
Date
Sep 21, 2017, 07:49 UTC
Message-ID
<20170921074932.5490-1-ijc@hellion.org.uk>
In-Reply-To
<1505980146.4636.9.camel@hellion.org.uk>

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>
---
 git-filter-branch.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 3a74602ef..3da281f8a 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
-- 
2.11.0
Previous: Ian CampbellNext: Ian Campbell
Message 4 of 8 in “filter-branch: support for incremental update + fix for ancient tag format”
  1. 0/4 filter-branch: support for incremental update + fix for ancient tag formatIan Campbell, Sep 21, 2017
  2. 2/4 filter-branch: preserve and restore $GIT_AUTHOR_* and $GIT_COMMITTER_*Ian Campbell, Sep 21, 2017
  3. 4/4 filter-branch: use hash-object instead of mktagIan Campbell, Sep 21, 2017
  4. 1/4 filter-branch: reset $GIT_* before cleaning upIan Campbell, Sep 21, 2017
  5. 3/4 filter-branch: stash away ref map in a branchIan Campbell, Sep 21, 2017
  6. Junio C HamanoSep 22, 2017
  7. Ian CampbellSep 22, 2017
  8. Junio C HamanoSep 22, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.