@matheusbsbs / matheus-bagliano / commits / 9489d0f197
Fork 0

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>

Matthias Lederhofer committed Jun 6, 2007 at 09:16 UTC 9489d0f197185d584294aa99a09a1b3c5ebb25e0
1 file changed +2 -1
git-filter-branch.sh
+2 -1
@@ -301,9 +301,10 @@ case "$GIT_DIR" in
301 /*)
302 ;;
303 *)
304 - export GIT_DIR="$(pwd)/../../$GIT_DIR"
304 + GIT_DIR="$(pwd)/../../$GIT_DIR"
305 ;;
306 esac
307 +export GIT_DIR GIT_WORK_TREE=.
308
309 export GIT_INDEX_FILE="$(pwd)/../index"
310 git-read-tree # seed the index file