File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -1448,6 +1448,13 @@ public void CheckoutBranch(Models.Branch branch)
14481448 }
14491449 }
14501450
1451+ public async Task CheckoutTagAsync ( Models . Tag tag )
1452+ {
1453+ var c = await new Commands . QuerySingleCommit ( _fullpath , tag . SHA ) . GetResultAsync ( ) ;
1454+ if ( c != null )
1455+ _histories ? . CheckoutBranchByCommit ( c ) ;
1456+ }
1457+
14511458 public async Task CompareBranchWithWorktree ( Models . Branch branch )
14521459 {
14531460 if ( _histories != null )
Original file line number Diff line number Diff line change 9696 <Border Height =" 24"
9797 Background =" Transparent"
9898 PointerPressed =" OnItemPointerPressed"
99+ DoubleTapped =" OnItemDoubleTapped"
99100 ContextRequested =" OnItemContextRequested"
100101 ToolTip.Placement=" Right" >
101102 <ToolTip .Tip>
Original file line number Diff line number Diff line change @@ -155,10 +155,20 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
155155 }
156156 }
157157
158- private void OnItemDoubleTapped ( object sender , TappedEventArgs e )
158+ private async void OnItemDoubleTapped ( object sender , TappedEventArgs e )
159159 {
160- if ( sender is Control { DataContext : ViewModels . TagTreeNode { IsFolder : true } node } )
161- ToggleNodeIsExpanded ( node ) ;
160+ if ( sender is Control { DataContext : ViewModels . TagTreeNode node } )
161+ {
162+ if ( node . IsFolder )
163+ ToggleNodeIsExpanded ( node ) ;
164+ else if ( DataContext is ViewModels . Repository repo )
165+ await repo . CheckoutTagAsync ( node . Tag ) ;
166+ }
167+ else if ( sender is Control { DataContext : Models . Tag tag } )
168+ {
169+ if ( DataContext is ViewModels . Repository repo )
170+ await repo . CheckoutTagAsync ( tag ) ;
171+ }
162172
163173 e . Handled = true ;
164174 }
You can’t perform that action at this time.
0 commit comments