Fix GetRepositoryRemote

This commit is contained in:
Jordan Brown
2017-12-03 17:10:27 -05:00
committed by GitHub
parent 68a0c870af
commit d897771939
+5
View File
@@ -115,6 +115,11 @@ namespace TGS.ControlPanel
}
//Assume standard gh format: [(git)|(https)]://github.com/owner/repo(.git)[0-1]
//Yes use .git twice in case it was weird
var toRemove = new string[] { ".git", "/", ".git" };
foreach (string item in toRemove)
if (remote.EndsWith(item))
remote = remote.Substring(0, remote.LastIndexOf(item));
var splits = remote.Split('/');
name = splits[splits.Length - 1];
owner = splits[splits.Length - 2].Split('.')[0];