On Tue, Mar 20, 2012 at 2:35 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Tim Henigan <tim.henigan@xxxxxxxxx> writes: > >> However, when 'difftool --dir-diff' is run from a subdirectory of the >> Git repository, there are problems. >> - The temporary index file generated by 'git update-index' appears >> to be correct. >> - 'git checkout-index --all --prefix=$tmp' command does not work >> (output tmp dir is empty). > > Hrmph. > > $ rm -fr /tmp/xyz > $ cd Documentation > $ git checkout-index --all --prefix=/tmp/xyz/ > $ ls -F /tmp/xyz > Documentation/ > $ rm -fr /tmp/xyz > $ GIT_DIR=$(pwd)/../.git GIT_WORK_TREE=$(pwd) \ > git checkout-index --all --prefix=/tmp/xyz/ > $ ls -FC /tmp/xyz | head -2 > abspath.c git-merge-octopus.sh* reflog-walk.c > aclocal.m4 git-merge-one-file.sh* reflog-walk.h > > Be sure to have the trailing slash in $tmp. It turns out that 'Git::command_oneline()' does not honor environment variables set prior to calling the function. This change fixed the problem: - $repo->command_oneline(["checkout-index", "-a", "--prefix=$ldir/"]); + $ENV{GIT_DIR} = $repo->repo_path(); + system(('git', 'checkout-index', '-a', "--prefix=$ldir/")); I'm still testing, but will submit an updated patch soon. -- 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