Skip to content
This repository was archived by the owner on Sep 20, 2022. It is now read-only.

Commit c29f75a

Browse files
author
Jake Ginnivan
committed
Fixed issue with remote detection
1 parent f7afd3f commit c29f75a

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/GitReleaseNotes.Tests/IssueTrackers/Jira/JiraIssueTrackerTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using System;
2-
using System.Collections.Generic;
3-
using GitReleaseNotes.IssueTrackers;
42
using GitReleaseNotes.IssueTrackers.Jira;
53
using LibGit2Sharp;
64
using NSubstitute;
7-
using Xunit;
85

96
namespace GitReleaseNotes.Tests.IssueTrackers.Jira
107
{

src/GitReleaseNotes/IssueTrackers/GitHub/GitHubIssueTracker.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ private bool TryRemote(out string organisation, out string repository, string re
9898
var upstream = _repository.Network.Remotes[remoteName];
9999
if (upstream != null && upstream.Url.ToLower().Contains("github.com"))
100100
{
101-
var match = Regex.Match(upstream.Url, "github.com[/:](?<org>.*?)/(?<repo>[^\\./]*)");
101+
var urlWithoutGitExtension = upstream.Url.EndsWith(".git") ? upstream.Url.Substring(0, upstream.Url.Length - 4) : upstream.Url;
102+
var match = Regex.Match(urlWithoutGitExtension, "github.com[/:](?<org>.*?)/(?<repo>.*)");
102103
if (match.Success)
103104
{
104105
organisation = match.Groups["org"].Value;

src/GitReleaseNotes/ReleaseFileWriter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
namespace GitReleaseNotes
24
{
35
public class ReleaseFileWriter
@@ -14,6 +16,7 @@ public void OutputReleaseNotesFile(string releaseNotesOutput, string outputFile)
1416
if (string.IsNullOrEmpty(outputFile))
1517
return;
1618
_fileSystem.WriteAllText(outputFile, releaseNotesOutput);
19+
Console.WriteLine("Release notes written to {0}", outputFile);
1720
}
1821
}
1922
}

0 commit comments

Comments
 (0)