Re: `git rev-parse --is-inside-work-tree` and $GIT_WORK_TREE
- From
Elliott Cable <me@ell.io>
- Date
- Mar 29, 2016, 11:53 UTC
- Message-ID
- <CAPZ477PD7SkRg7T_Y_n27Hjw5TeW6Sh0-vtoP6-4xUDraC7OiA@mail.gmail.com>
- In-Reply-To
- <CAPZ477NxXVNNwDvzaFt7GoUGuJwnOuX3y1N+aPtVRFD3E8dQBA@mail.gmail.com>
On Tue, Mar 29, 2016 at 6:42 AM, Elliott Cable <me@ell.io> wrote:
> So, I find this behaviour a little strange; I can't determine if it's > a subtle bug, or intentionally undefined/‘fuzzy’ behaviour ...
Oh lord, it gets worse ...
$ cd a-repo $ git rev-parse --is-inside-work-tree; git rev-parse --is-inside-git-dir true false $ cd .git $ git rev-parse --is-inside-work-tree; git rev-parse --is-inside-git-dir false true $ export GIT_WORK_TREE="$(git rev-parse --show-toplevel)" # !!! $ git rev-parse --is-inside-work-tree; git rev-parse --is-inside-git-dir true false $ # !!?!?
So, basically, if `$GIT_WORK_TREE` is set at all, it appears that the `rev-parse --is-inside...` flags don't function reliably at all.
⁓ ELLIOTTCABLE — fly safe. http://ell.io/tt