Submodule not working with specified work-tree

From: Jimmy Zelinskie <hidden>
Date: 2016-06-15 23:04:12

It seems like submodule isn't picking up on the work tree that I'm
specifying. In the scenario that I'm working with, I'd prefer to not
have to "cd" into a directory to update the submodules. All the other
git subcommands that I'm executing work fine with specifying the git
dir and work tree via envvars or parameters. I'm not sure if this is a
bug or not.

$ git --git-dir $HOME/testrepo/.git --work-tree $HOME/testrepo
submodule update --init --recursive
fatal: /usr/local/Cellar/git/2.3.0/libexec/git-core/git-submodule
cannot be used without a working tree.

$ GIT_WORK_TREE=$HOME/testrepo GIT_DIR=$HOME/testrepo/.git git
submodule update --init --recursive
fatal: /usr/local/Cellar/git/2.3.0/libexec/git-core/git-submodule
cannot be used without a working tree.

$ git version
git version 2.3.0

$ uname -a
Darwin hanazawa.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22
23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help