mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
fix<Branches>: fix crash reported by https://gitee.com/sourcegit/sourcegit/issues/I43RRK
This commit is contained in:
parent
fb8a6c2585
commit
164501db01
1 changed files with 4 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue