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 74aab78 commit d5262a9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/compat/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,23 @@ 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 d5262a9

Please sign in to comment.