All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bence Ferdinandy <bence@ferdinandy.com>
To: git@vger.kernel.org
Cc: "Fővárosi Vízművek Zrt." <noreply@vizmuvek.hu>,
	"Bence Ferdinandy" <bence@ferdinandy.com>
Subject: [PATCH v10 1/8] t/t5505-remote: set default branch to main
Date: Mon, 21 Oct 2024 15:36:58 +0200	[thread overview]
Message-ID: <20241021134354.705636-2-bence@ferdinandy.com> (raw)
In-Reply-To: <20241021134354.705636-1-bence@ferdinandy.com>

Consider the bare repository called "mirror" in the test.  Running `git
remote add --mirror -f origin ../one` will not change HEAD, consequently
if init.defaultBranch is not the same as what HEAD in the remote
("one"), HEAD in "mirror" will be pointing to a non-existent reference.
Hence if "mirror" is used as a remote by yet another repository,
ls-remote will not show HEAD. On the other hand, if init.defaultBranch
happens to match HEAD in "one", then ls-remote will show HEAD.

Since the CI globally exports GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main,
there's a drift between how the test repositories are set up in the CI
and during local testing. This issue does not manifest currently, as the
test does not do any remote HEAD manipulation where this would come up,
but should such things be added, a locally passing test would break the
CI vice-versa.

Set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main in the test to be
consistent with the CI.
---

Notes:
    v9: - new patch
        - a bandaid for the CI issue noticed by Taylor (cf:
          https://lore.kernel.org/git/Zw8IKyPkG0Hr6%2F5t@nand.local/), but
          see
          https://lore.kernel.org/git/D4ZAELFWJMKN.S88LJ6YK31LZ@ferdinandy.com/ for the root cause in detail
    
    v10: no change

 t/t5505-remote.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 532035933f..9b50276646 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -2,6 +2,9 @@
 
 test_description='git remote porcelain-ish'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
-- 
2.47.0.94.g8861098b6d


  reply	other threads:[~2024-10-21 13:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1088915169.629942.1729445083543@FVRT-HAMMYAS-P.vizmuvek.hu>
2024-10-21 13:36 ` [PATCH v10 0/8] set-head/fetch remote/HEAD updates Bence Ferdinandy
2024-10-21 13:36   ` Bence Ferdinandy [this message]
2024-10-21 13:36   ` [PATCH v10 2/8] refs: atomically record overwritten ref in update_symref Bence Ferdinandy
2024-10-21 13:37   ` [PATCH v10 3/8] remote set-head: refactor for readability Bence Ferdinandy
2024-10-21 13:37   ` [PATCH v10 4/8] remote set-head: better output for --auto Bence Ferdinandy
2024-10-21 13:37   ` [PATCH v10 5/8] refs: add TRANSACTION_CREATE_EXISTS error Bence Ferdinandy
2024-10-21 13:37   ` [PATCH v10 6/8] refs: add create_only option to refs_update_symref_extended Bence Ferdinandy
2024-10-21 13:37   ` [PATCH v10 7/8] fetch: set remote/HEAD if it does not exist Bence Ferdinandy
2024-10-21 13:37   ` [PATCH v10 8/8] fetch set_head: handle mirrored bare repositories Bence Ferdinandy
2024-10-21 20:43   ` [PATCH v10 0/8] set-head/fetch remote/HEAD updates Taylor Blau
2024-10-21 21:06     ` Bence Ferdinandy
2024-10-22 17:39   ` Taylor Blau
2024-10-22 18:33     ` Bence Ferdinandy
2024-10-22 19:04       ` Taylor Blau
2024-10-22 19:09         ` Bence Ferdinandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241021134354.705636-2-bence@ferdinandy.com \
    --to=bence@ferdinandy.com \
    --cc=git@vger.kernel.org \
    --cc=noreply@vizmuvek.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.