Dulwich.io dulwich / d55d4a2
Support plain strings as refspec arguments to dulwich.porcelain.push. Jelmer Vernooij 6 months ago
3 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1010 * Import from ``collections.abc`` rather than ``collections`` where
1111 applicable. Required for 3.8 compatibility.
1212 (Jelmer Vernooij)
13
14 * Support plain strings as refspec arguments to
15 ``dulwich.porcelain.push``. (Jelmer Vernooij)
1316
1417 BUG FIXES
1518
8686 :return: A tuple with left and right ref
8787 :raise KeyError: If one of the refs can not be found
8888 """
89 refspec = to_bytes(refspec)
8990 if refspec.startswith(b"+"):
9091 force = True
9192 refspec = refspec[1:]
9293 else:
9394 force = False
94 refspec = to_bytes(refspec)
9595 if b":" in refspec:
9696 (lh, rh) = refspec.split(b":")
9797 else:
173173 self.assertEqual((b"refs/heads/foo", None, False),
174174 parse_reftuple(r, r, b"refs/heads/foo:"))
175175
176 def test_default_with_string(self):
177 r = {b"refs/heads/foo": "bla"}
178 self.assertEqual((b"refs/heads/foo", b"refs/heads/foo", False),
179 parse_reftuple(r, r, "foo"))
180
176181
177182 class ParseReftuplesTests(TestCase):
178183