Set GIT_WORK_TREE relative to repository.
authorgregor herrmann <gregoa@debian.org>
Tue, 27 Sep 2011 16:25:53 +0000 (18:25 +0200)
committergregor herrmann <gregoa@debian.org>
Tue, 27 Sep 2011 16:25:53 +0000 (18:25 +0200)
$PWD only works when called in ~/.

movein

diff --git a/movein b/movein
index 7746641..ea98b73 100755 (executable)
--- a/movein
+++ b/movein
@@ -155,7 +155,7 @@ add() {
        git config core.bare false
        git config core.worktree ../../
        git config status.showUntrackedFiles no
-       GIT_WORK_TREE="$PWD" git pull
+       GIT_WORK_TREE="$LOCAL_REPO/../../" git pull
        trap - 0
 
        mr -c "$MRCONFIG" config "$LOCAL_REPO" checkout="git_fake_bare_checkout '$REPO_URL' 'REPO_NAME' '../../'"
@@ -198,7 +198,7 @@ new() {
        git config core.bare false
        git config core.worktree ../../
        git config status.showUntrackedFiles no
-       export GIT_WORK_TREE="$PWD"
+       export GIT_WORK_TREE="$LOCAL_REPO/../../"
        git add "$@"
        git commit -m "initial checkin"
        git push --all