Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit bdda514

Browse files
committed
Merge branch 'master' into bump-libgit2sharp-octokit
2 parents c1d1fe9 + b028aa6 commit bdda514

32 files changed

+557
-287
lines changed

documentation/manifest.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
- [ ] Verify Issues button navigates to Issues page on GitHub.com (when logged in and the repository is enabled)
9494
- [ ] **Creating Multiple Repositories**
9595
- [ ] Go to Team Explorer Connect page (logged in)
96-
- [ ] Create additional repository
97-
- [ ] Publish new repository
98-
- [ ] Verify remote information present in repository settings
96+
- [ ] Create additional repository
97+
- [ ] Publish new repository
98+
- [ ] Verify remote information present in repository settings
9999
- [ ] **Validate Publish Repository Error**
100100
- [ ] Remove remote settings from repository
101101
- [ ] Go to Sync page and publish repository
@@ -121,3 +121,10 @@
121121
- [ ] **Login with 2FA on**
122122
- [ ] Login GitHub with 2FA turned on
123123
- [ ] Resend works
124+
125+
# Settings
126+
- [ ] **Property page loads outside of team explorer view**
127+
- [ ] Select solution explorer as focused pane
128+
- [ ] Restart Visual Studio
129+
- [ ] Go to GitHub for VS property pane in Options
130+
- [ ] Property page loads without errors

src/GitHub.App/Factories/HostCacheFactory.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,23 @@ public IBlobCache Create(HostAddress hostAddress)
3939

4040
IOperatingSystem OperatingSystem { get { return operatingSystem.Value; } }
4141
IBlobCacheFactory BlobCacheFactory { get { return blobCacheFactory.Value; } }
42+
43+
bool disposed;
44+
protected virtual void Dispose(bool disposing)
45+
{
46+
if (disposing)
47+
{
48+
if (disposed) return;
49+
disposed = true;
50+
if (blobCacheFactory.IsValueCreated)
51+
blobCacheFactory.Value.Dispose();
52+
}
53+
}
54+
55+
public void Dispose()
56+
{
57+
Dispose(true);
58+
GC.SuppressFinalize(this);
59+
}
4260
}
4361
}

src/GitHub.App/Factories/IBlobCacheFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using Akavache;
2+
using System;
23

34
namespace GitHub.Factories
45
{
5-
public interface IBlobCacheFactory
6+
public interface IBlobCacheFactory : IDisposable
67
{
78
IBlobCache CreateBlobCache(string path);
89
}

src/GitHub.App/Factories/IHostCacheFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using Akavache;
22
using GitHub.Primitives;
3+
using System;
34

45
namespace GitHub.Factories
56
{
6-
public interface IHostCacheFactory
7+
public interface IHostCacheFactory : IDisposable
78
{
89
IBlobCache Create(HostAddress hostAddress);
910
}

src/GitHub.App/Factories/RepositoryHostFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected virtual void Dispose(bool disposing)
5151

5252
loginCache.Dispose();
5353
avatarProvider.Dispose();
54+
hostCacheFactory.Dispose();
5455
disposed = true;
5556
}
5657
}

src/GitHub.App/Factories/SqlitePersistentBlobCacheFactory.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,56 @@
22
using Akavache.Sqlite3;
33
using NLog;
44
using System;
5+
using System.Collections.Generic;
56
using System.ComponentModel.Composition;
7+
using System.Reactive.Disposables;
68

79
namespace GitHub.Factories
810
{
911
[Export(typeof(IBlobCacheFactory))]
1012
[PartCreationPolicy(CreationPolicy.Shared)]
1113
public class SqlitePersistentBlobCacheFactory : IBlobCacheFactory
1214
{
15+
readonly CompositeDisposable disposables = new CompositeDisposable();
1316
static readonly Logger log = LogManager.GetCurrentClassLogger();
17+
Dictionary<string, IBlobCache> cache = new Dictionary<string, IBlobCache>();
1418

1519
public IBlobCache CreateBlobCache(string path)
1620
{
1721
Guard.ArgumentNotEmptyString(path, nameof(path));
22+
if (cache.ContainsKey(path))
23+
return cache[path];
1824

1925
try
2026
{
21-
return new SQLitePersistentBlobCache(path);
27+
var c = new SQLitePersistentBlobCache(path);
28+
cache.Add(path, c);
29+
disposables.Add(c);
30+
return c;
2231
}
2332
catch(Exception ex)
2433
{
2534
log.Error("Error while creating SQLitePersistentBlobCache for {0}. {1}", path, ex);
2635
return new InMemoryBlobCache();
2736
}
2837
}
38+
39+
bool disposed;
40+
protected virtual void Dispose(bool disposing)
41+
{
42+
if (disposing)
43+
{
44+
if (disposed) return;
45+
disposed = true;
46+
disposables.Dispose();
47+
}
48+
}
49+
50+
public void Dispose()
51+
{
52+
Dispose(true);
53+
GC.SuppressFinalize(this);
54+
}
55+
2956
}
3057
}

src/GitHub.App/SampleData/SampleViewModels.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@ public class GitHubHomeSectionDesigner : IGitHubHomeSection
525525
{
526526
public GitHubHomeSectionDesigner()
527527
{
528-
Icon = Octicon.@lock;
528+
Icon = Octicon.repo;
529529
RepoName = "octokit";
530-
RepoUrl = "https://github.com/octokit/octokit.net";
530+
RepoUrl = "https://github.com/octokit/something-really-long-here-to-check-for-trimming";
531531
}
532532

533533
public Octicon Icon

src/GitHub.App/Services/ModelService.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,6 @@ protected virtual void Dispose(bool disposing)
277277
if (disposing)
278278
{
279279
if (disposed) return;
280-
281-
try
282-
{
283-
hostCache.Dispose();
284-
}
285-
catch (Exception e)
286-
{
287-
log.Warn("Exception occured while disposing host cache", e);
288-
}
289280
disposed = true;
290281
}
291282
}

src/GitHub.App/ViewModels/LoginControlViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public LoginControlViewModel(
4545

4646
}).ToProperty(this, x => x.LoginMode);
4747

48-
AuthenticationResults = Observable.Amb(
48+
AuthenticationResults = Observable.Merge(
4949
loginToGitHubViewModel.Login,
5050
EnterpriseLogin.Login);
5151
CancelCommand = ReactiveCommand.Create();

src/GitHub.Exports/GitHub.Exports.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@
136136
<DesignTime>True</DesignTime>
137137
<DependentUpon>IPackageSettings.tt</DependentUpon>
138138
</Compile>
139+
<Compile Include="Settings\GitHubConnectSectionState.cs" />
140+
<Compile Include="Settings\UIState.cs" />
139141
<Compile Include="ViewModels\IServiceProviderAware.cs" />
140142
<Compile Include="UI\IView.cs" />
141143
<Compile Include="UI\Octicon.cs" />

0 commit comments

Comments
 (0)