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)
1448
1448
}
1449
1449
}
1450
1450
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
+
1451
1458
public async Task CompareBranchWithWorktree ( Models . Branch branch )
1452
1459
{
1453
1460
if ( _histories != null )
Original file line number Diff line number Diff line change 96
96
<Border Height =" 24"
97
97
Background =" Transparent"
98
98
PointerPressed =" OnItemPointerPressed"
99
+ DoubleTapped =" OnItemDoubleTapped"
99
100
ContextRequested =" OnItemContextRequested"
100
101
ToolTip.Placement=" Right" >
101
102
<ToolTip .Tip>
Original file line number Diff line number Diff line change @@ -155,10 +155,20 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
155
155
}
156
156
}
157
157
158
- private void OnItemDoubleTapped ( object sender , TappedEventArgs e )
158
+ private async void OnItemDoubleTapped ( object sender , TappedEventArgs e )
159
159
{
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
+ }
162
172
163
173
e . Handled = true ;
164
174
}
You can’t perform that action at this time.
0 commit comments