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

[PATCH] t2402: test worktree path when called in .git directory

From
HGHariom Verma via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 4, 2020, 07:00 UTC
Message-ID
<pull.570.git.1583305200143.gitgitgadget@gmail.com>
From: Hariom Verma <hariom18599@gmail.com>

The bug which reports an extra `/.git/.` in worktree path when called in '.git' directory already has been fixed. But unfortunately, the regression test to ensure this behavior has been forgotten. Here is that test.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Hariom Verma <hariom18599@gmail.com>
---
    t2402: test worktree path when called in .git directory
    
    Regression test to ensure that the bug (i.e. extra /.git/. in worktree
    path when called in '.git' directory) has been fixed correctly.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-570%2Fharry-hov%2Fverify-get_main_worktree-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-570/harry-hov/verify-get_main_worktree-fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/570
 t/t2402-worktree-list.sh | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index bb6fb9b12cb..ef397386dc7 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -151,4 +151,10 @@ test_expect_success 'linked worktrees are sorted' '
 	test_cmp expected sorted/main/actual
 '
 
+test_expect_success 'worktree path when called in .git directory' '
+	git worktree list> list1 &&
+	git -C .git worktree list> list2 &&
+	test_cmp list1 list2
+'
+
 test_done

base-commit: 4ef346482d6d5748861c1aa9d56712e847369b40
-- 
gitgitgadget
Next: Eric Sunshine
Message 1 of 3 in “t2402: test worktree path when called in .git directory”
  1. t2402: test worktree path when called in .git directoryHariom Verma via GitGitGadget, Mar 4, 2020
  2. Eric SunshineMar 4, 2020
  3. Junio C HamanoMar 4, 2020

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.