| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Allow users to specify additional repository extensions that they want to support. For example, callers can specify that they support `preciousObjects` and then may open repositories that support `extensions.preciousObjects`. Similarly, callers may opt out of supporting extensions that the library itself supports.
|
Thx @ethomson, I created a draft PR to test it in libgit2sharp: libgit2/libgit2sharp#1908 I can confirm it works as expected as I was able to open repositories with "partialclone" extension! 🤘🏼 While writing the tests I was not sure about the behavior when setting the extensions two times in a row: GlobalSettings.SetExtensions(new[] { "!noop" });
Assert.Empty(GlobalSettings.GetExtensions());
GlobalSettings.SetExtensions(new[] { "partialclone", "newext" });
Assert.Equal(new[] { "noop", "partialclone", "newext" }, GlobalSettings.GetExtensions()); // 👈🏼 I expected "noop" to remain disabled |
Sorry, something went wrong.
|
Right - sorry, I expect you to call it one time with what you support. (Subsequent calls will reset the supported extensions.) I think that this is not super important in practice since most people will only call it once at startup and forget about it. But it made testing easier in the library. If you have strong opinions that I did this wrong then I'm definitely open to reconsidering. |
Sorry, something went wrong.
@ethomson Not at all, I just mentioned it in case this behavior was not expected. |
Sorry, something went wrong.
| git_odb__loose_priority = va_arg(ap, int); | ||
| break; | ||
|
|
||
| case GIT_OPT_SET_EXTENSIONS: |
There was a problem hiding this comment.
(code indent looks incorrect)
Sorry, something went wrong.
|
🥳 |
Sorry, something went wrong.
|
@ethomson Do you plan to release a version that includes this in a near future? |
Sorry, something went wrong.
|
@jairbubbles Yes. I would like to do a v1.3.0 this weekend. |
Sorry, something went wrong.
|
Sounds like a nice plan. I'll wait for 1.3.0 and update it in libGit2Sharp. |
Sorry, something went wrong.
- C# wrapper for libgit2/libgit2#6031 (I'm not sure at all for the P/Invoke code)
- C# wrapper for libgit2/libgit2#6031 (I'm not sure at all for the P/Invoke code)
This would allow one to use git worktrees together with sparse-checkout. Reference: libgit2/libgit2#6031
* Add support for custom git extensions This would allow one to use git worktrees together with sparse-checkout. Reference: libgit2/libgit2#6031 * Mark extension methods unsafe * Replace custom spin-lock in tests with serial-test crate * Rewrite tests as integration tests
| Back | FazBrowse Home | New Git URL |
Allow users to specify additional repository extensions that they want to support. For example, callers can specify that they support preciousObjects and then may open repositories that support extensions.preciousObjects.
Similarly, callers may opt out of supporting extensions that the library itself supports.