# git describe --dirty doesn't work with --work-tree

1 messages from 2019-01-25 to 2019-01-25. Participants: Blixt.
Thread: https://gitlist.dev/t/50320

## Blixt, 2019-01-25 14:05

Subject: git describe --dirty doesn't work with --work-tree
Message-ID: <CAFYJ4vur8KUbvnPaq2McR874K6o5YS6pCkKnihdwN758CKkwng@mail.gmail.com>
URL: https://gitlist.dev/e/CAFYJ4vur8KUbvnPaq2McR874K6o5YS6pCkKnihdwN758CKkwng%40mail.gmail.com
In-Reply-To: <CAFYJ4vvGhwxd5wTq-yYeOy6Hq-GpCsTy6=jG-LoHn2mShM4_NQ@mail.gmail.com>

```
In a script of mine I want to describe HEAD without changing the
current directory, so I specify --git-dir and --work-tree. But it
appears the --dirty check doesn't consider the --work-tree value.

Here's a simplified example (on macOS 10.14.1):

$ git version
git version 2.20.1
$ mkdir test
$ cd test
$ git init
Initialized empty Git repository in /Users/example/test/.git/
$ touch test
$ git add test
$ git commit -m "initial commit"
[master (root-commit) 9fc4511] initial commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test
$ git describe --all --dirty
heads/master
$ cd ..
$ git --git-dir test/.git --work-tree test describe --all --dirty
heads/master-dirty

```
