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

Commit

Permalink
Merge branch 'release/2.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik committed Jan 15, 2017
2 parents 6390adb + 46815cb commit 1f91090
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/GitLink.Tests/Providers/GitHubProviderFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void ReturnsValidInitialization()
}

[TestCase]
public void ReturnsInValidInitialization()
public void ReturnsInvalidInitialization()
{
var provider = new GitHubProvider();
var valid = provider.Initialize("https://bitbucket.org/CatenaLogic/GitLink");
Expand Down Expand Up @@ -81,6 +81,15 @@ public void ReturnsValidRawGitUrl()

Assert.AreEqual("https://raw.github.com/CatenaLogic/GitLink", provider.RawGitUrl);
}

[TestCase]
public void ReturnsValidRawGitUrlWhenDotGitSuffixIsPresent()
{
var provider = new GitHubProvider();
provider.Initialize("https://github.com/CatenaLogic/GitLink.git");

Assert.AreEqual("https://raw.github.com/CatenaLogic/GitLink", provider.RawGitUrl);
}
}
}
}
2 changes: 1 addition & 1 deletion src/GitLink/Providers/GitHubProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace GitLink.Providers

public class GitHubProvider : ProviderBase
{
private readonly Regex _gitHubRegex = new Regex(@"(?<url>(?<companyurl>(?:https://)?github\.com/(?<company>[^/]+))/(?<project>[^/]+))");
private readonly Regex _gitHubRegex = new Regex(@"^(?<url>(?<companyurl>(?:https://)?github\.com/(?<company>[^/]+))/(?<project>[^/]+?)(\.git)?)$");

public GitHubProvider()
: base(new GitPreparer())
Expand Down

0 comments on commit 1f91090

Please sign in to comment.