Aaron Brooks <aaron <at> brooks1.net> writes:
> Unlike other commands, git stash doesn't work outside of the worktree,
> even when --work-tree is specified:
> It looks like the "require_work_tree" function should check the
> environment variables in addition to the status of the PWD (via
> Having looked through several of the other git-*.sh scripts, I think
> other shell based git commands will have similar problems.
The environment variables are properly exported. I verified this by
adding 'echo $GIT_WORK_TREE; echo $GIT_DIR' at the top of git-stash.sh.
So these should propagate to "child gits" just fine, and so it shouldn't
be necessary to test them explicitly.
The problem seems to be that git rev-parse --is-inside-work-tree does
not honor these. In fact it doesn't even honor --git-dir or --work-tree.
Judging by the name this may be intentional.
In the mean time, if you are able to use Git 1.8.5, `git -C test-repo
stash` will work just fine.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html