Dulwich.io dulwich / 224632e
Consistently use refs/heads/packed rather than refs/some/packed. Thanks, KS Chan. Jelmer Vernooń≥ 2 months ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
334334
335335 def test_setitem(self):
336336 RefsContainerTests.test_setitem(self)
337 f = open(os.path.join(self._refs.path, b'refs', b'some', b'ref'), 'rb')
338 self.assertEqual(b'42d06bd4b77fed026b154d16493e5deab78f02ec',
339 f.read()[:40])
340 f.close()
337 path = os.path.join(self._refs.path, b'refs', b'some', b'ref')
338 with open(path, 'rb') as f:
339 self.assertEqual(b'42d06bd4b77fed026b154d16493e5deab78f02ec',
340 f.read()[:40])
341341
342342 self.assertRaises(
343343 OSError, self._refs.__setitem__,
347347 with open(os.path.join(self._refs.path, 'packed-refs'), 'w') as f:
348348 f.write('# pack-refs with: peeled fully-peeled sorted \n')
349349 f.write(
350 '42d06bd4b77fed026b154d16493e5deab78f02ec refs/some/packed\n')
350 '42d06bd4b77fed026b154d16493e5deab78f02ec refs/heads/packed\n')
351351
352352 # It's allowed to set a new ref on a packed ref, the new ref will be
353353 # placed outside on refs/
363363
364364 self.assertRaises(
365365 OSError, self._refs.__setitem__,
366 b'refs/some/packed/sub',
366 b'refs/heads/packed/sub',
367367 b'42d06bd4b77fed026b154d16493e5deab78f02ec')
368368
369369 def test_setitem_symbolic(self):