Skip to content

Commit

Permalink
fix branch picker issue when repo has stash
Browse files Browse the repository at this point in the history
  • Loading branch information
yysun committed Oct 9, 2011
1 parent b0a1579 commit 1bbda02
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
4 changes: 3 additions & 1 deletion BasicSccProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,9 @@ private void OnSwitchBranchCommand(object sender, EventArgs e)
{
if (sccService.CurrentTracker == null || sccService.CurrentTracker.Repository == null) return;

var branchPicker = new BranchPicker(sccService.CurrentTracker.Repository);
var branchPicker = new BranchPicker(
sccService.CurrentTracker.Repository,
sccService.CurrentTracker.RepositoryGraph.Refs);
branchPicker.Show();
}

Expand Down
11 changes: 8 additions & 3 deletions GitFileStatusTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,14 @@ public GitFileStatus GetFileStatus(string fileName)

if (!this.cache.ContainsKey(fileName))
{
var status = GetFileStatusNoCache(fileName);
this.cache.Add(fileName, status);
//Debug.WriteLine(string.Format("GetFileStatus {0} - {1}", fileName, status));
var status = GitFileStatus.NotControlled;
try
{
status = GetFileStatusNoCache(fileName);
this.cache.Add(fileName, status);
//Debug.WriteLine(string.Format("GetFileStatus {0} - {1}", fileName, status));
}
catch { }
return status;
}
else
Expand Down
12 changes: 6 additions & 6 deletions UI/BranchPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Windows.Shapes;
using NGit;
using NGit.Api;
using GitScc.DataServices;

namespace GitScc.UI
{
Expand All @@ -22,15 +23,17 @@ namespace GitScc.UI
public partial class BranchPicker : UserControl
{
private Window window;
Repository repository;
private Repository repository;
private List<DataServices.Ref> list;

public string BranchName { get; set; }
public bool CreateNew { get; set; }

public BranchPicker(Repository repository)
public BranchPicker(Repository repository, List<DataServices.Ref> list)
{
InitializeComponent();
this.repository = repository;
this.list = list;
}

internal bool? Show()
Expand All @@ -45,10 +48,7 @@ public BranchPicker(Repository repository)
Height = 200
};

comboBranches.ItemsSource = repository.GetAllRefs().Values
.Where(r => !r.IsSymbolic())
.Select(r => r.GetName().Substring(11));

comboBranches.ItemsSource = list.Where(r=>r.Type == RefTypes.Branch).Select(r => r.Name);
comboBranches.SelectedValue = repository.GetBranch();
return window.ShowDialog();
}
Expand Down
2 changes: 1 addition & 1 deletion source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Identifier Id="C4128D99-2000-41D1-A6C3-704E6C1A3DE2">
<Name>Git Source Control Provider</Name>
<Author>[email protected]</Author>
<Version>0.8.4</Version>
<Version>0.8.5</Version>
<Description xml:space="preserve">Git Source Control Provider is a plug-in that integrates git with Visual Studio.</Description>
<Locale>1033</Locale>
<License>License.txt</License>
Expand Down

0 comments on commit 1bbda02

Please sign in to comment.