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

Implement object checkout in PrepareCheckout #1483

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Fernthedev
Copy link
Contributor

@Fernthedev Fernthedev commented Aug 1, 2024

In continuation of #1403, I implemented with_object_id to allow checking out specific commits such as is the case in submodules.

This currently does not include any test cases as of writing this. However, I did make sure this worked from a high level in my project

Though this does not properly update the HEAD and may not clone properly. Hoping I can fix it by using util::update_head and refactoring it to use oid, though I leave that decision up to you if you have a better idea.

Apologies for the lack of tests as well.

Tasks:

  • Checkout tree associated with the oid of the revision used.
  • Update the HEAD with util::update_head to use the correct detached state.
  • Add tests ensuring this works as intended
  • Shallow clone with specific revision, then checkout.
  • Standard clone while checking out specific revision

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks for contributing!

Maybe you could add a task list to communicate what you think is missing to make this PR reviewable.

gix/src/clone/checkout.rs Outdated Show resolved Hide resolved
@Fernthedev
Copy link
Contributor Author

Alright, I added some tasks as requested though the extent of my knowledge with this process is limited so there might be more things I'm not aware of.

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