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

[PATCH] filter-branch: really allow running in a bare repository

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 3, 2009, 18:10 UTC
Message-ID
<alpine.DEB.1.00.0902031910001.9822@pacific.mpi-cbg.de>
In-Reply-To
<cover.1233684552u.git.johannes.schindelin@gmx.de>

When checking if running in a bare repository, the work tree has to be reset, otherwise we will be checking the temporary state, which is always non-bare.

This commit augments a4661b0(git-filter-branch.sh: Allow running in bare repositories).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-filter-branch.sh |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index eb62f71..8cbce4e 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -469,19 +469,19 @@ 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
+}
+test -z "$ORIG_GIT_WORK_TREE" || {
+	GIT_WORK_TREE="$ORIG_GIT_WORK_TREE" &&
+	export GIT_WORK_TREE
+}
+test -z "$ORIG_GIT_INDEX_FILE" || {
+	GIT_INDEX_FILE="$ORIG_GIT_INDEX_FILE" &&
+	export GIT_INDEX_FILE
+}
 if [ "$(is_bare_repository)" = false ]; then
-	unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
-	test -z "$ORIG_GIT_DIR" || {
-		GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR
-	}
-	test -z "$ORIG_GIT_WORK_TREE" || {
-		GIT_WORK_TREE="$ORIG_GIT_WORK_TREE" &&
-		export GIT_WORK_TREE
-	}
-	test -z "$ORIG_GIT_INDEX_FILE" || {
-		GIT_INDEX_FILE="$ORIG_GIT_INDEX_FILE" &&
-		export GIT_INDEX_FILE
-	}
 	git read-tree -u -m HEAD
 fi
 
-- 
1.6.1.2.574.g140d5
Next: Eric Kidd
Message 1 of 4 in “filter-branch: really allow running in a bare repository”
  1. filter-branch: really allow running in a bare repositoryJohannes Schindelin, Feb 3, 2009
  2. Eric KiddFeb 3, 2009
  3. Johannes SchindelinFeb 3, 2009
  4. Eric KiddFeb 3, 2009

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.