@@ -26,7 +26,6 @@ public Models.Branch SelectedLocalBranch
2626 public List < Models . Branch > LocalBranches
2727 {
2828 get ;
29- private set ;
3029 }
3130
3231 public List < Models . Remote > Remotes
@@ -157,7 +156,7 @@ public override Task<bool> Sure()
157156 {
158157 _repo . SetWatcherEnabled ( false ) ;
159158
160- var remoteBranchName = _selectedRemoteBranch . Name . Replace ( " (new)" , "" ) ;
159+ var remoteBranchName = _selectedRemoteBranch . Name ;
161160 ProgressDescription = $ "Push { _selectedLocalBranch . Name } -> { _selectedRemote . Name } /{ remoteBranchName } ...";
162161
163162 return Task . Run ( ( ) =>
@@ -187,7 +186,7 @@ private void AutoSelectBranchByRemote()
187186 branches . Add ( branch ) ;
188187 }
189188
190- // If selected local branch has upstream branch . Try to find it in current remote branches.
189+ // If selected local branch has upstream. Try to find it in current remote branches.
191190 if ( ! string . IsNullOrEmpty ( _selectedLocalBranch . Upstream ) )
192191 {
193192 foreach ( var branch in branches )
@@ -201,7 +200,7 @@ private void AutoSelectBranchByRemote()
201200 }
202201 }
203202
204- // Find best remote branch by name.
203+ // Try to find a remote branch with the same name of selected local branch .
205204 foreach ( var branch in branches )
206205 {
207206 if ( _selectedLocalBranch . Name == branch . Name )
@@ -215,7 +214,7 @@ private void AutoSelectBranchByRemote()
215214 // Add a fake new branch.
216215 var fake = new Models . Branch ( )
217216 {
218- Name = $ " { _selectedLocalBranch . Name } (new)" ,
217+ Name = _selectedLocalBranch . Name ,
219218 Remote = _selectedRemote . Name ,
220219 } ;
221220 branches . Add ( fake ) ;
@@ -226,7 +225,7 @@ private void AutoSelectBranchByRemote()
226225 private readonly Repository _repo = null ;
227226 private Models . Branch _selectedLocalBranch = null ;
228227 private Models . Remote _selectedRemote = null ;
229- private List < Models . Branch > _remoteBranches = new List < Models . Branch > ( ) ;
228+ private List < Models . Branch > _remoteBranches = [ ] ;
230229 private Models . Branch _selectedRemoteBranch = null ;
231230 private bool _isSetTrackOptionVisible = false ;
232231 }
0 commit comments