git-reset does not seem to respect GIT_WORK_TREE
- From
Patrick Palka <patrick@parcs.ath.cx>
- Date
- Feb 14, 2014, 18:57 UTC
- Message-ID
- <CA+C-WL_x=+OPn4Ec-6Y13w1+dd5G5v8W6=i15WH47pyP3ggjuw@mail.gmail.com>
Hi everyone,
I noticed that git-reset does not seem to respect GIT_WORK_TREE. Here is a simplified test case:
$ mkdir src_dir && cd src_dir $ git init $ touch A && git add A && git commit -m "Dummy commit." $ mkdir ../build_dir && cd ../build_dir $ export GIT_WORK_TREE=../src_dir $ export GIT_DIR=../src_dir/.git $ git reset Unstaged changes after reset: D A
The final command "git reset" erroneously suggests that the file "A" does not exist in the working tree. Does anybody know why git-reset behaves this way?
Thanks, Patrick