This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +25
-10
lines changed
Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 11
22Microsoft Visual Studio Solution File, Format Version 12.00
3- # Visual Studio 15
4- VisualStudioVersion = 15 .0.26403.7
3+ # Visual Studio 14
4+ VisualStudioVersion = 14 .0.25420.1
55MinimumVisualStudioVersion = 10.0.40219.1
66Project ("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" ) = "GitHub.VisualStudio" , "src\GitHub.VisualStudio\GitHub.VisualStudio.csproj" , "{11569514-5AE5-4B5B-92A2-F10B0967DE5F}"
77 Project Section (ProjectDependencies ) = postProject
Original file line number Diff line number Diff line change @@ -105,10 +105,11 @@ public IObservable<Unit> Pull(ILocalRepositoryModel repository)
105105
106106 public IObservable < Unit > Push ( ILocalRepositoryModel repository )
107107 {
108- return Observable . Defer ( ( ) =>
108+ return Observable . Defer ( async ( ) =>
109109 {
110110 var repo = gitService . GetRepository ( repository . LocalPath ) ;
111- return gitClient . Push ( repo , repo . Head . TrackedBranch . UpstreamBranchCanonicalName , repo . Head . Remote . Name ) . ToObservable ( ) ;
111+ var remote = await gitClient . GetHttpRemote ( repo , repo . Head . Remote . Name ) ;
112+ return gitClient . Push ( repo , repo . Head . TrackedBranch . UpstreamBranchCanonicalName , remote . Name ) . ToObservable ( ) ;
112113 } ) ;
113114 }
114115
@@ -171,8 +172,13 @@ public IObservable<BranchTrackingDetails> CalculateHistoryDivergence(ILocalRepos
171172 return Observable . Defer ( async ( ) =>
172173 {
173174 var repo = gitService . GetRepository ( repository . LocalPath ) ;
175+
174176 if ( repo . Head . Remote != null )
175- await gitClient . Fetch ( repo , repo . Head . Remote . Name ) ;
177+ {
178+ var remote = await gitClient . GetHttpRemote ( repo , repo . Head . Remote . Name ) ;
179+ await gitClient . Fetch ( repo , remote . Name ) ;
180+ }
181+
176182 return Observable . Return ( repo . Head . TrackingDetails ) ;
177183 } ) ;
178184 }
Original file line number Diff line number Diff line change @@ -7,20 +7,19 @@ namespace GitHub.InlineReviews.Peek
77{
88 class InlineCommentPeekableItem : IPeekableItem
99 {
10- readonly InlineCommentPeekViewModel viewModel ;
11-
1210 public InlineCommentPeekableItem ( InlineCommentPeekViewModel viewModel )
1311 {
14- this . viewModel = viewModel ;
12+ ViewModel = viewModel ;
1513 }
1614
1715 public string DisplayName => "GitHub Code Review" ;
16+ public InlineCommentPeekViewModel ViewModel { get ; }
1817
1918 public IEnumerable < IPeekRelationship > Relationships => new [ ] { InlineCommentPeekRelationship . Instance } ;
2019
2120 public IPeekResultSource GetOrCreateResultSource ( string relationshipName )
2221 {
23- return new InlineCommentPeekableResultSource ( viewModel ) ;
22+ return new InlineCommentPeekableResultSource ( ViewModel ) ;
2423 }
2524 }
2625}
Original file line number Diff line number Diff line change 11using System ;
22using System . ComponentModel . Composition ;
3+ using System . Linq ;
4+ using System . Reactive . Linq ;
35using System . Threading . Tasks ;
46using GitHub . Api ;
57using GitHub . Extensions ;
@@ -96,7 +98,15 @@ public ITrackingPoint Show(ITextView textView, AddInlineCommentTag tag)
9698
9799 ExpandCollapsedRegions ( textView , line . Extent ) ;
98100
99- peekBroker . TriggerPeekSession ( textView , trackingPoint , InlineCommentPeekRelationship . Instance . Name ) ;
101+ var session = peekBroker . TriggerPeekSession ( textView , trackingPoint , InlineCommentPeekRelationship . Instance . Name ) ;
102+ var item = session . PeekableItems . OfType < InlineCommentPeekableItem > ( ) . FirstOrDefault ( ) ;
103+
104+ if ( item != null )
105+ {
106+ var placeholder = item . ViewModel . Thread . Comments . Last ( ) ;
107+ placeholder . CancelEdit . Take ( 1 ) . Subscribe ( _ => session . Dismiss ( ) ) ;
108+ }
109+
100110 return trackingPoint ;
101111 }
102112
You can’t perform that action at this time.
0 commit comments