Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ab3b46

Browse files
committed
Ensure FetchOptions property is non-null
1 parent 4de7c4f commit 4ab3b46

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

LibGit2Sharp/CloneOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public CloneOptions()
4646
/// <summary>
4747
/// Gets or sets the fetch options.
4848
/// </summary>
49-
public FetchOptions FetchOptions { get; set; }
49+
public FetchOptions FetchOptions { get; set; } = new();
5050

5151
#region IConvertableToGitCheckoutOpts
5252

LibGit2Sharp/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ public static string Clone(string sourceUrl, string workdirPath,
760760
Ensure.ArgumentNotNull(sourceUrl, "sourceUrl");
761761
Ensure.ArgumentNotNull(workdirPath, "workdirPath");
762762

763-
options = options ?? new CloneOptions();
763+
options ??= new CloneOptions();
764764

765765
// context variable that contains information on the repository that
766766
// we are cloning.

0 commit comments

Comments
 (0)