Skip to content

Checkout - #240

Merged
arthurschreiber merged 15 commits into
libgit2:developmentfrom
arthurschreiber:checkout
Aug 26, 2013
Merged

arthurschreiber merged 15 commits into
libgit2:developmentfrom
arthurschreiber:checkout

Conversation

@arthurschreiber

Copy link
Copy Markdown
Member

This adds the Repository#checkout method to switch or detach HEAD, and Repository#checkout_tree to checkout all or individual files from a specific branch/commit/tag/revspec.

This superseedes #107, which has been outdated for quite some time.

@arthurschreiber arthurschreiber mentioned this pull request Jul 23, 2013
4 of 12 tasks
Comment thread lib/rugged/repository.rb Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

branch here can't be remote if you don't specify branch_type in Branch.lookup, it defaults to local branches only.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I need to fix this and add some tests for it .:/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should get rid of the branch_type arg and call just git_reference_is_remote in Branch.lookup?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Care to elaborate? I'm not exactly sure what you mean by this. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, ignore my last comment.

What I meant is, that I hallucinated something that can't work.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

@arthurschreiber

Copy link
Copy Markdown
Member Author

I think this should be fine to merge, only need a 👍 from @vmg.

@vmg

vmg commented Aug 26, 2013

Copy link
Copy Markdown
Member

Looks good! Can you rebase and merge? :)

@arthurschreiber

Copy link
Copy Markdown
Member Author

I rebased against development, but saw that Repository#checkout_tree is still missing docs. I'll finish that up and merge then.

@arthurschreiber

Copy link
Copy Markdown
Member Author

Actually, I've no idea where I got that from. Everything is document. :/

arthurschreiber added a commit that referenced this pull request Aug 26, 2013
@arthurschreiber
arthurschreiber merged commit d6428a0 into libgit2:development Aug 26, 2013
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.

3 participants