This ensures that nothing breaks the basic functionality of describe for
bare repositories. Please note that --broken and --dirty need a working
tree.

Signed-off-by: Sebastian Staudt <korak...@gmail.com>
---
 t/t6120-describe.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index a9e3bf0ce0..ee5b03ee18 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -143,6 +143,12 @@ test_expect_success 'rename tag Q back to A' '
 test_expect_success 'pack tag refs' 'git pack-refs'
 check_describe A-* HEAD
 
+test_expect_success 'describe works from outside repo using --git-dir' '
+       git clone --bare "$TRASH_DIRECTORY" "$TRASH_DIRECTORY/bare" &&
+       git --git-dir "$TRASH_DIRECTORY/bare" describe >out &&
+       grep "^A-[1-9][0-9]\?-g[0-9a-f]\+$" out
+'
+
 check_describe "A-*[0-9a-f]" --dirty
 
 test_expect_success 'describe --dirty with --work-tree' '
-- 
2.20.1

Reply via email to