git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v5 2/2] t6120: test for describe with a bare repository

From
Sebastian Staudt <koraktor@gmail.com>
Date
Feb 3, 2019, 06:00 UTC
Message-ID
<20190203060025.7486-2-koraktor@gmail.com>
In-Reply-To
<20190203060025.7486-1-koraktor@gmail.com>

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 <koraktor@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
Previous: Sebastian Staudt
Message 2 of 2 in “describe: setup working tree for --dirty”
  1. 1/2 describe: setup working tree for --dirtySebastian Staudt, Feb 3, 2019
  2. 2/2 t6120: test for describe with a bare repositorySebastian Staudt, Feb 3, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.