mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 13:51:53 +08:00
fix<Branches>: fix crash reported by https://gitee.com/sourcegit/sourcegit/issues/I43RRK
This commit is contained in:
@@ -39,7 +39,10 @@ namespace SourceGit.Commands {
|
||||
branch.IsLocal = true;
|
||||
} else if (refName.StartsWith(PREFIX_REMOTE, StringComparison.Ordinal)) {
|
||||
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.IsLocal = false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user