From 629eea01e90907ed9ed82790d05c962f1d6ad47a Mon Sep 17 00:00:00 2001 From: djmattyg007 Date: Sat, 23 Aug 2014 11:23:17 +1000 Subject: [PATCH] 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. --- pygit2/repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygit2/repository.py b/pygit2/repository.py index 45bc170..26f3033 100644 --- a/pygit2/repository.py +++ b/pygit2/repository.py @@ -263,7 +263,7 @@ class Repository(_Repository): return self.checkout_head(**kwargs) # Case 3: Reference - if type(refname) is Reference: + if isinstance(refname, Reference): reference = refname refname = refname.name else: