summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Lederhofer <matled@gmx.net>2007-06-06 07:16:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-06 23:08:37 (GMT)
commit9489d0f197185d584294aa99a09a1b3c5ebb25e0 (patch)
tree73db17ebbfe1bece12ffbcbfe236ad86ab56c672
parent3270736bd1e63c63679f64f8325690889322df08 (diff)
downloadgit-9489d0f197185d584294aa99a09a1b3c5ebb25e0.zip
git-9489d0f197185d584294aa99a09a1b3c5ebb25e0.tar.gz
git-9489d0f197185d584294aa99a09a1b3c5ebb25e0.tar.bz2
filter-branch: always export GIT_DIR if it is set
Currently filter-branch exports GIT_DIR only if it is an relative path but git-sh-setup might also set GIT_DIR to an absolute path that is not exported yet. Additionally export GIT_WORK_TREE with GIT_DIR to ensure that cwd is used as working tree even for bare repositories. Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--[-rwxr-xr-x]git-filter-branch.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 9d61b7f..614f7bd 100755..100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -301,9 +301,10 @@ case "$GIT_DIR" in
/*)
;;
*)
- export GIT_DIR="$(pwd)/../../$GIT_DIR"
+ GIT_DIR="$(pwd)/../../$GIT_DIR"
;;
esac
+export GIT_DIR GIT_WORK_TREE=.
export GIT_INDEX_FILE="$(pwd)/../index"
git-read-tree # seed the index file