diff options
authorJohannes Schindelin <>2020-10-08 10:13:46 (GMT)
committerJunio C Hamano <>2020-10-08 17:40:16 (GMT)
commita15ad5d1bc23f3a6842360df5ee840b1dc3e4888 (patch)
parentd98273ba77e1ab9ec755576bc86c716a97bf59d7 (diff)
t1415: avoid using `main` as ref name
In preparation for a patch series that will change the fall-back for `init.defaultBranch` to `main`, let's not use `main` as ref name in this test script. Otherwise, the `git for-each-ref ... | grep main` which wants to catch those refs would also unexpectedly catch `refs/heads/main`. Since the refs in question are worktree-local ones (i.e. each worktree has their own, just like `HEAD`), and since the test case already uses a secondary worktree called "second", let's use the name "first" for those refs instead. While at it, adjust the test titles that talk about a "repo" when they meant a "worktree" instead. Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
1 files changed, 9 insertions, 9 deletions
diff --git a/t/ b/t/
index bb2c757..7ab9124 100755
--- a/t/
+++ b/t/
@@ -76,24 +76,24 @@ test_expect_success 'reflog of worktrees/xx/HEAD' '
test_cmp expected actual.wt2
-test_expect_success 'for-each-ref from main repo' '
+test_expect_success 'for-each-ref from main worktree' '
mkdir fer1 &&
git -C fer1 init repo &&
test_commit -C fer1/repo initial &&
git -C fer1/repo worktree add ../second &&
- git -C fer1/repo update-ref refs/bisect/main HEAD &&
- git -C fer1/repo update-ref refs/rewritten/main HEAD &&
- git -C fer1/repo update-ref refs/worktree/main HEAD &&
- git -C fer1/repo for-each-ref --format="%(refname)" | grep main >actual &&
+ git -C fer1/repo update-ref refs/bisect/first HEAD &&
+ git -C fer1/repo update-ref refs/rewritten/first HEAD &&
+ git -C fer1/repo update-ref refs/worktree/first HEAD &&
+ git -C fer1/repo for-each-ref --format="%(refname)" | grep first >actual &&
cat >expected <<-\EOF &&
- refs/bisect/main
- refs/rewritten/main
- refs/worktree/main
+ refs/bisect/first
+ refs/rewritten/first
+ refs/worktree/first
test_cmp expected actual
-test_expect_success 'for-each-ref from linked repo' '
+test_expect_success 'for-each-ref from linked worktree' '
mkdir fer2 &&
git -C fer2 init repo &&
test_commit -C fer2/repo initial &&