This commit is contained in:
leo 2021-08-04 09:07:31 +08:00
parent fb8a6c2585
commit 164501db01

View file

@ -39,7 +39,10 @@ namespace SourceGit.Commands {
branch.IsLocal = true; branch.IsLocal = true;
} else if (refName.StartsWith(PREFIX_REMOTE, StringComparison.Ordinal)) { } else if (refName.StartsWith(PREFIX_REMOTE, StringComparison.Ordinal)) {
var name = refName.Substring(PREFIX_REMOTE.Length); var name = refName.Substring(PREFIX_REMOTE.Length);
branch.Remote = name.Substring(0, name.IndexOf('/')); var shortNameIdx = name.IndexOf('/');
if (shortNameIdx < 0) return;
branch.Remote = name.Substring(0, shortNameIdx);
branch.Name = name.Substring(branch.Remote.Length + 1); branch.Name = name.Substring(branch.Remote.Length + 1);
branch.IsLocal = false; branch.IsLocal = false;
} else { } else {