[PATCH (amend)] filter-branch: always export GIT_DIR if it is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
The last one was a bit bloated :)
---
 git-filter-branch.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 0c8a7df..acd52bd 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -315,9 +315,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
-- 
1.5.2.1.116.g9f308

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux