Skip to content

Commit b16ffb8

Browse files
committed
Fixed remote handling for pull, checkintool, and rcheckin
1 parent e5e11d0 commit b16ffb8

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

GitTfsDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private void PullButtonClick(object sender, EventArgs e)
6666
if (PullRadioButton.Checked)
6767
{
6868
_settings.PullSetting = PullSetting.Pull;
69-
if (!_commands.StartGitTfsCommandProcessDialog("pull"))
69+
if (!_commands.StartGitTfsCommandProcessDialog("pull", "--remote " + TfsRemoteComboBox.Text))
7070
{
7171
_commands.StartResolveConflictsDialog();
7272
}
@@ -117,7 +117,7 @@ private void PushButtonClick(object sender, EventArgs e)
117117
if (CheckinRadioButton.Checked)
118118
{
119119
_settings.PushSetting = PushSetting.Checkin;
120-
_commands.StartGitTfsCommandProcessDialog("checkintool");
120+
_commands.StartGitTfsCommandProcessDialog("checkintool", "--remote " + TfsRemoteComboBox.Text);
121121
}
122122
else if (ShelveRadioButton.Checked)
123123
{
@@ -127,7 +127,7 @@ private void PushButtonClick(object sender, EventArgs e)
127127
else if (RCheckinRadioButton.Checked)
128128
{
129129
_settings.PushSetting = PushSetting.RCheckin;
130-
_commands.StartGitTfsCommandProcessDialog("rcheckin");
130+
_commands.StartGitTfsCommandProcessDialog("rcheckin", "--remote " + TfsRemoteComboBox.Text);
131131
}
132132
this.Close();
133133
}

GitTfsPlugin.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.Linq;
43
using System.Reflection;
5-
using System.Text;
64
using System.Text.RegularExpressions;
75
using System.Windows.Forms;
86
using GitUIPluginInterfaces;
@@ -50,9 +48,9 @@ public bool Execute(GitUIBaseEventArgs gitUiCommands)
5048
private static IEnumerable<string> GetTfsRemotes(IGitUICommands commands)
5149
{
5250
var result = commands.GitCommand("config --get-regexp tfs-remote");
53-
var match = Regex.Match(result, @"tfs-remote\.([^\.]+)");
54-
return match.Success
55-
? match.Groups.Cast<Group>().Skip(1).Select(g => g.Value)
51+
var matches = Regex.Matches(result, @"tfs-remote\.([^\.]+)");
52+
return matches.Count > 0
53+
? matches.Cast<Match>().Select(g => g.Groups[1].Value).Distinct()
5654
: Enumerable.Empty<string>();
5755
}
5856

0 commit comments

Comments
 (0)