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
base: master
Are you sure you want to change the base?
Adds Depth to FetchOptions allowing for shallow cloning #2070
Conversation
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; |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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)
@amirvenus Do you have write-access and can get this merged? |
This PR adds
Depth
toFetchOptions
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