diff mbox series

[b4] tests: explicitly clone master branch from git bundle

Message ID 20230108-tests-default-branch-v1-1-58000cfdf024@t-8ch.de (mailing list archive)
State Accepted, archived
Headers show
Series [b4] tests: explicitly clone master branch from git bundle | expand

Commit Message

Thomas Weißschuh Jan. 8, 2023, 9:24 p.m. UTC
If not specified git tries to use the local default branch when cloning
from a bundle.
If the configuration "init.defaultBranch" is not "master" then the clone
from the bundle will not actually clone anything, breaking all the
tests.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
 tests/conftest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: a055dede8ca9606b7fb4242816fb68054515e047
change-id: 20230108-tests-default-branch-70f74f633e34

Best regards,

Comments

Konstantin Ryabitsev Jan. 11, 2023, 6:38 p.m. UTC | #1
On Sun, 08 Jan 2023 21:24:20 +0000, Thomas Weißschuh wrote:
> If not specified git tries to use the local default branch when cloning
> from a bundle.
> If the configuration "init.defaultBranch" is not "master" then the clone
> from the bundle will not actually clone anything, breaking all the
> tests.
> 
> 
> [...]

Applied, thanks!

[1/1] tests: explicitly clone master branch from git bundle
      commit: f72d94dfbbfb5cdba0b37621367ccf2508a8d6b4

Best regards,
diff mbox series

Patch

diff --git a/tests/conftest.py b/tests/conftest.py
index d8338cc4c408..8b0a8f7b5794 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -38,7 +38,7 @@  def gitdir(request, tmp_path):
         bfile = os.path.join(sampledir, 'gitdir.bundle')
     assert os.path.exists(bfile)
     dest = os.path.join(tmp_path, 'repo')
-    args = ['clone', bfile, dest]
+    args = ['clone', '--branch', 'master', bfile, dest]
     out, logstr = b4.git_run_command(None, args)
     assert out == 0
     b4.git_set_config(dest, 'user.name', b4.USER_CONFIG['name'])