Skip to content

Add support to pass "initial head" on repo init#1926

Closed
zentron wants to merge 1 commit intolibgit2:masterfrom
OctopusDeploy:octopus/init-branch
Closed

Add support to pass "initial head" on repo init#1926
zentron wants to merge 1 commit intolibgit2:masterfrom
OctopusDeploy:octopus/init-branch

Conversation

@zentron
Copy link
Contributor

@zentron zentron commented Nov 22, 2021

By default when initializing a new repository, the initial head is set to be whatever the globally configured value from init.defaultBranch. LibGit2Sharp was already exposing the InitialHead pointer to pass a value down to libgit2 however it was not being exposed through the managed classes.
This change introduces an InitOptions class to provide this optional parameter.

@zentron zentron force-pushed the octopus/init-branch branch from ee97bbf to a08b0ad Compare December 3, 2021 04:25
@zentron
Copy link
Contributor Author

zentron commented Dec 3, 2021

Resolves: #1929

/// <summary>
/// Optional parameters when invoking Init.
/// </summary>
public sealed class InitOptions
Copy link

Choose a reason for hiding this comment

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

Hi @zentron , may I ask you to have a look at this commit in our fork and consider adopting changes from it?

mendix/libgit2sharp@d6e7723

More specifically, it might be great to include both WorkdirPath and IsBare into the InitOptions class.

Thanks!

@zentron zentron closed this Jul 18, 2025
@zentron zentron deleted the octopus/init-branch branch July 18, 2025 11:32
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.

1 participant