Skip to content

Commit 4de96fc

Browse files
committed
Use git config to make overlapping remotes in a test repo
Instead of `git remote`. Since Git 2.51.0, path collisions in remote names are automatically detected and rejected when `git remote add` is used to attempt to add them, since creating such collisions is usually unintentional: git/git@a5a727c However, we deliberately do this in our test suite, in the `make_remote_config_repos.sh` fixture script. When Git 2.51.0 came to be used on CI, some new test failures arose as a result, as observed in GitoxideLabs#2130. This fixes the script by using two `git config` commands rather than a `git remote` command to produce the overlap. This technique is (intentionally) still allowed in Git 2.51.0.
1 parent 8cabd16 commit 4de96fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gix/tests/fixtures/make_remote_config_repos.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ git clone fetch multiple-remotes
140140
git remote add with/two/slashes ../fetch
141141
git fetch with/two/slashes
142142

143-
git remote add with/two ../fetch
143+
git config remote.with/two.url ../fetch
144+
git config remote.with/two.fetch '+refs/heads/*:refs/remotes/with/two/*'
144145
git fetch with/two
145146

146147
# add a specialised refspec mapping

0 commit comments

Comments
 (0)