Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing of Branch objects to Repository.checkout() #408

Merged
merged 2 commits into from
Aug 26, 2014
Merged

Allow passing of Branch objects to Repository.checkout() #408

merged 2 commits into from
Aug 26, 2014

Conversation

djmattyg007
Copy link
Contributor

Currently the Repository.checkout() method checks to see if the refname
parameter is a Reference object with the following check:

if type(refname) is Reference:

This does not allow subclasses of Reference (such as Branch) to be used.

This pull request remedies this issue by changing the check to use
instanceof(), like so:

if instanceof(refname, Reference):

This pull request also adds a new test for this functionality.

Branch inherits from Reference, so there's no reason why we shouldn't be
able to pass a Branch object.
This differs from the only other test which uses a Reference object.
This test only succeeds because of the previous commit.
@jdavid jdavid merged commit 14bcce0 into libgit2:master Aug 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants