Skip to content

Commit

Permalink
add compat test case which verifies behaviour with a non-default symref
Browse files Browse the repository at this point in the history
  • Loading branch information
stspdotname committed Oct 30, 2024
1 parent d440d64 commit 754b5b4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/compat/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,21 @@ def test_fetch_pack(self):
dest.refs.set_if_equals(r[0], None, r[1])
self.assertDestEqualsSrc()

def test_fetch_pack_with_nondefault_symref(self):
c = self._client()
src = repo.Repo(os.path.join(self.gitroot, "server_new.export"))
src.refs.add_if_new(b"refs/heads/main", src.refs[b"refs/heads/master"])
src.refs.set_symbolic_ref(b"HEAD", b"refs/heads/main")
with repo.Repo(os.path.join(self.gitroot, "dest")) as dest:
result = c.fetch(self._build_path("/server_new.export"), dest)
self.assertEqual(
{b"HEAD": b"refs/heads/main"},
result.symrefs,
)
for r in result.refs.items():
dest.refs.set_if_equals(r[0], None, r[1])
self.assertDestEqualsSrc()

def test_fetch_pack_depth(self):
c = self._client()
with repo.Repo(os.path.join(self.gitroot, "dest")) as dest:
Expand Down

0 comments on commit 754b5b4

Please sign in to comment.