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

Add support for custom git extensions #791

Merged
merged 4 commits into from
Jan 24, 2022

Conversation

knutwalker
Copy link
Contributor

This would allow one to use git worktrees together with sparse-checkout.

Reference: libgit2/libgit2#6031

This would allow one to use git worktrees together with sparse-checkout.

Reference: libgit2/libgit2#6031
knutwalker added a commit to knutwalker/starship that referenced this pull request Jan 21, 2022
Allows the use of git worktrees together with sparse-checkout.
In order for git2 to open such repositories, we need to tell it
that we support the worktreeConfig extension.

Fixes starship#3245

This commit requires rust-lang/git2-rs#791
@alexcrichton
Copy link
Member

Seems reasonable to me! For the tests though since this modifies global state I think it'd be good to have a separate test executable in tests/*.rs instead of in the main suite of tests (which would also remove the need for the serial-test crate I think)

@knutwalker
Copy link
Contributor Author

Thanks for the hint! I have moved the tests to the tests/ folder and rewritten them a bit. They now look like what I initially wanted them to look like, much better :)

@alexcrichton alexcrichton merged commit c55bd6d into rust-lang:master Jan 24, 2022
knutwalker added a commit to knutwalker/starship that referenced this pull request Mar 30, 2022
Allows the use of git worktrees together with sparse-checkout.
In order for git2 to open such repositories, we need to tell it
that we support the worktreeConfig extension.

Fixes starship#3245

This commit requires rust-lang/git2-rs#791
chipbuster pushed a commit to knutwalker/starship that referenced this pull request May 2, 2022
Allows the use of git worktrees together with sparse-checkout.
In order for git2 to open such repositories, we need to tell it
that we support the worktreeConfig extension.

Fixes starship#3245

This commit requires rust-lang/git2-rs#791
jpgrayson pushed a commit to stacked-git/stgit that referenced this pull request Sep 10, 2022
Since 0.13, a few changes have been made to git2, including
rust-lang/git2-rs#791 which should address the
extensions.worktreeConfig issue in #195.

The upgrade required fixing uses of [ConfigEntries][1] because it's no
longer an iterator.

[1]: https://docs.rs/git2/0.15.0/git2/struct.ConfigEntries.html

However, it provides an API that lends itself well to `while let`
to provide a for loop like experience, so this was an easy fix.
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