Skip to content

Commit 24fa13f

Browse files
authored
fix: build folder path from Backend.Path and silence null-revision bindings in revision file tree (#2595)
- RevisionFileTreeView.SetSearchResultAsync: concatenate Backend.Path instead of stringifying the Backend Object, whose default ToString() leaked "SourceGit.Models.Object/" into child node paths and corrupted the DirHistories window title. - RevisionFiles / Blame: add FallbackValue={x:Null} to Commit.SHA / Revision.SHA. These commits are loaded asynchronously and are null when the view first binds, which logged "Value is null" binding errors.
1 parent 4b4c22f commit 24fa13f

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Views/Blame.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@
116116
FontWeight="Bold"
117117
Margin="0,0,6,0"
118118
FontFamily="{DynamicResource Fonts.Monospace}"
119-
Text="{Binding Revision.SHA, Converter={x:Static c:StringConverters.ToShortSHA}, Mode=OneWay}"/>
119+
Text="{Binding Revision.SHA, Converter={x:Static c:StringConverters.ToShortSHA}, Mode=OneWay, FallbackValue={x:Null}}"/>
120120

121121
<TextBlock Grid.Column="1"
122-
Text="{Binding Revision.Subject}"
122+
Text="{Binding Revision.Subject, FallbackValue={x:Null}}"
123123
TextTrimming="CharacterEllipsis"/>
124124
</Grid>
125125
</Border>

src/Views/RevisionFileTreeView.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public async Task SetSearchResultAsync(string file)
312312

313313
last.Add(folder);
314314
last = folder.Children;
315-
prefix = folder.Backend + "/";
315+
prefix = folder.Backend.Path + "/";
316316
}
317317

318318
last.Add(new ViewModels.RevisionFileTreeNode

src/Views/RevisionFiles.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109

110110
<!-- File Tree -->
111111
<Border Grid.Row="1" Margin="0,4,0,0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}">
112-
<v:RevisionFileTreeView x:Name="FileTree" Revision="{Binding Commit.SHA}" SearchRequested="OnToggleSearch"/>
112+
<v:RevisionFileTreeView x:Name="FileTree" Revision="{Binding Commit.SHA, FallbackValue={x:Null}}" SearchRequested="OnToggleSearch"/>
113113
</Border>
114114
</Grid>
115115

0 commit comments

Comments
 (0)