mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
Fetch only added remote; Show remote has no branches
This commit is contained in:
parent
9691fd33a8
commit
dbd7a13705
2 changed files with 1093 additions and 1081 deletions
|
@ -1,4 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace SourceGit.Git {
|
namespace SourceGit.Git {
|
||||||
|
@ -57,7 +57,7 @@ namespace SourceGit.Git {
|
||||||
if (errs != null) {
|
if (errs != null) {
|
||||||
App.RaiseError(errs);
|
App.RaiseError(errs);
|
||||||
} else {
|
} else {
|
||||||
repo.Fetch(null, true, null);
|
repo.Fetch(new Remote() { Name = name }, true, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,7 @@ namespace SourceGit.UI {
|
||||||
private void UpdateBranches(bool force = true) {
|
private void UpdateBranches(bool force = true) {
|
||||||
Task.Run(() => {
|
Task.Run(() => {
|
||||||
var branches = repo.Branches(force);
|
var branches = repo.Branches(force);
|
||||||
|
var remotes = repo.Remotes(true);
|
||||||
var localBranchNodes = new List<BranchNode>();
|
var localBranchNodes = new List<BranchNode>();
|
||||||
var remoteNodes = new List<RemoteNode>();
|
var remoteNodes = new List<RemoteNode>();
|
||||||
var remoteMap = new Dictionary<string, RemoteNode>();
|
var remoteMap = new Dictionary<string, RemoteNode>();
|
||||||
|
@ -233,6 +234,17 @@ namespace SourceGit.UI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var r in remotes) {
|
||||||
|
if (!remoteMap.ContainsKey(r.Name)) {
|
||||||
|
var remote = new RemoteNode() {
|
||||||
|
Name = r.Name,
|
||||||
|
IsExpanded = false,
|
||||||
|
Children = new List<BranchNode>(),
|
||||||
|
};
|
||||||
|
remoteNodes.Add(remote);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SortBranchNodes(localBranchNodes);
|
SortBranchNodes(localBranchNodes);
|
||||||
foreach (var r in remoteNodes) SortBranchNodes(r.Children);
|
foreach (var r in remoteNodes) SortBranchNodes(r.Children);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue