Skip to content

Commit

Permalink
filter-branch: always export GIT_DIR if it is set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthias Lederhofer authored and Junio C Hamano committed Jun 6, 2007
1 parent 3270736 commit 9489d0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-filter-branch.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9489d0f

Please sign in to comment.