Allow objects of type Branch to be passed to Repository.checkout()

Branch inherits from Reference, so there's no reason why we shouldn't be
able to pass a Branch object.
This commit is contained in:
djmattyg007
2014-08-23 11:23:17 +10:00
parent 82b342937f
commit 629eea01e9

View File

@@ -263,7 +263,7 @@ class Repository(_Repository):
return self.checkout_head(**kwargs) return self.checkout_head(**kwargs)
# Case 3: Reference # Case 3: Reference
if type(refname) is Reference: if isinstance(refname, Reference):
reference = refname reference = refname
refname = refname.name refname = refname.name
else: else: