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

Adds Depth to FetchOptions allowing for shallow cloning #2070

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

andersklepaker
Copy link

This PR adds Depth to FetchOptions allowing for shallow cloning.

Since I'm new to this repo and it's complexity it's possible i've missed some key information to why this have not been implemented, and if so I'm sorry for not reading up on it prior to submitting this PR.

Resolves #229

@fmargerit
Copy link

Hello, what's next for this pull request ?

@andersklepaker
Copy link
Author

Hello, what's next for this pull request ?

Someone needs to review and approve it I guess. Not sure if this is something @bording could do?

/// Default value is 0 (full) fetch.
/// </para>
/// </summary>
public int Depth { get; set; } = 0;

Choose a reason for hiding this comment

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

This seems to be unnecessary

// a new instance of GitFetchOptions we only populate the Depth field.
var fetchOptions = new GitFetchOptions
{
Depth = options.FetchOptions.Depth,

Choose a reason for hiding this comment

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

FetchOptions could be null at this point - possible NRE

@@ -794,7 +801,7 @@ public static string Clone(string sourceUrl, string workdirPath)
}

using (var checkoutOptionsWrapper = new GitCheckoutOptsWrapper(options))
using (var fetchOptionsWrapper = new GitFetchOptionsWrapper())
using (var fetchOptionsWrapper = new GitFetchOptionsWrapper(fetchOptions))

Choose a reason for hiding this comment

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

We need another test for this extra options : what if it is null and being passed to the ctor?

Also, how about using using var ... (we might want to remove the brackets)

@andersklepaker
Copy link
Author

@amirvenus Do you have write-access and can get this merged?

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.

Shallow clone support
3 participants