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

Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit b24a00c

Browse files
author
Ruben Verdoes
committed
Ensure sourceUrl is not null either
1 parent 81def25 commit b24a00c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

LibGit2Sharp.Tests/CloneFixture.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,5 +234,13 @@ public void CloningWithoutWorkdirPathThrows(string url)
234234
{
235235
Assert.Throws<ArgumentNullException>(() => Repository.Clone(url, null));
236236
}
237+
238+
[Fact]
239+
public void CloningWithoutUrlThrows()
240+
{
241+
var scd = BuildSelfCleaningDirectory();
242+
243+
Assert.Throws<ArgumentNullException>(() => Repository.Clone(null, scd.DirectoryPath));
244+
}
237245
}
238246
}

LibGit2Sharp/Repository.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ public static string Discover(string startingPath)
538538
public static string Clone(string sourceUrl, string workdirPath,
539539
CloneOptions options = null)
540540
{
541+
Ensure.ArgumentNotNull(sourceUrl, "sourceUrl");
541542
Ensure.ArgumentNotNull(workdirPath, "workdirPath");
542543

543544
options = options ?? new CloneOptions();

0 commit comments

Comments
 (0)