[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