Skip to content

Commit 74d77ab

Browse files
committed
Merge branch 'release/v2025.22'
2 parents 932baee + b617181 commit 74d77ab

File tree

119 files changed

+972
-532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+972
-532
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
100100
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
101101

102102
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
103-
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
103+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
104104

105105
# use accessibility modifiers
106106
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion

TRANSLATION.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ This document shows the translation status of each locale file in the repository
66

77
### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)
88

9-
### ![de__DE](https://img.shields.io/badge/de__DE-96.38%25-yellow)
9+
### ![de__DE](https://img.shields.io/badge/de__DE-96.14%25-yellow)
1010

1111
<details>
1212
<summary>Missing keys in de_DE.axaml</summary>
1313

1414
- Text.Avatar.Load
1515
- Text.BranchCM.ResetToSelectedCommit
16+
- Text.Checkout.WithFastForward
17+
- Text.Checkout.WithFastForward.Upstream
1618
- Text.CommitDetail.Changes.Count
1719
- Text.CreateBranch.OverwriteExisting
1820
- Text.DeinitSubmodule
@@ -43,16 +45,9 @@ This document shows the translation status of each locale file in the repository
4345

4446
</details>
4547

46-
### ![es__ES](https://img.shields.io/badge/es__ES-99.88%25-yellow)
48+
### ![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)
4749

48-
<details>
49-
<summary>Missing keys in es_ES.axaml</summary>
50-
51-
- Text.Avatar.Load
52-
53-
</details>
54-
55-
### ![fr__FR](https://img.shields.io/badge/fr__FR-92.26%25-yellow)
50+
### ![fr__FR](https://img.shields.io/badge/fr__FR-92.03%25-yellow)
5651

5752
<details>
5853
<summary>Missing keys in fr_FR.axaml</summary>
@@ -67,6 +62,8 @@ This document shows the translation status of each locale file in the repository
6762
- Text.Bisect.WaitingForRange
6863
- Text.BranchCM.ResetToSelectedCommit
6964
- Text.Checkout.RecurseSubmodules
65+
- Text.Checkout.WithFastForward
66+
- Text.Checkout.WithFastForward.Upstream
7067
- Text.CommitCM.CopyAuthor
7168
- Text.CommitCM.CopyCommitter
7269
- Text.CommitCM.CopySubject
@@ -122,13 +119,15 @@ This document shows the translation status of each locale file in the repository
122119

123120
</details>
124121

125-
### ![it__IT](https://img.shields.io/badge/it__IT-97.63%25-yellow)
122+
### ![it__IT](https://img.shields.io/badge/it__IT-97.38%25-yellow)
126123

127124
<details>
128125
<summary>Missing keys in it_IT.axaml</summary>
129126

130127
- Text.Avatar.Load
131128
- Text.BranchCM.ResetToSelectedCommit
129+
- Text.Checkout.WithFastForward
130+
- Text.Checkout.WithFastForward.Upstream
132131
- Text.CommitDetail.Changes.Count
133132
- Text.CreateBranch.OverwriteExisting
134133
- Text.DeinitSubmodule
@@ -149,7 +148,7 @@ This document shows the translation status of each locale file in the repository
149148

150149
</details>
151150

152-
### ![ja__JP](https://img.shields.io/badge/ja__JP-92.01%25-yellow)
151+
### ![ja__JP](https://img.shields.io/badge/ja__JP-91.78%25-yellow)
153152

154153
<details>
155154
<summary>Missing keys in ja_JP.axaml</summary>
@@ -165,6 +164,8 @@ This document shows the translation status of each locale file in the repository
165164
- Text.BranchCM.CompareWithCurrent
166165
- Text.BranchCM.ResetToSelectedCommit
167166
- Text.Checkout.RecurseSubmodules
167+
- Text.Checkout.WithFastForward
168+
- Text.Checkout.WithFastForward.Upstream
168169
- Text.CommitCM.CopyAuthor
169170
- Text.CommitCM.CopyCommitter
170171
- Text.CommitCM.CopySubject
@@ -221,7 +222,7 @@ This document shows the translation status of each locale file in the repository
221222

222223
</details>
223224

224-
### ![pt__BR](https://img.shields.io/badge/pt__BR-84.02%25-yellow)
225+
### ![pt__BR](https://img.shields.io/badge/pt__BR-83.81%25-yellow)
225226

226227
<details>
227228
<summary>Missing keys in pt_BR.axaml</summary>
@@ -245,6 +246,8 @@ This document shows the translation status of each locale file in the repository
245246
- Text.BranchCM.ResetToSelectedCommit
246247
- Text.BranchUpstreamInvalid
247248
- Text.Checkout.RecurseSubmodules
249+
- Text.Checkout.WithFastForward
250+
- Text.Checkout.WithFastForward.Upstream
248251
- Text.Clone.RecurseSubmodules
249252
- Text.CommitCM.CopyAuthor
250253
- Text.CommitCM.CopyCommitter
@@ -357,9 +360,17 @@ This document shows the translation status of each locale file in the repository
357360

358361
</details>
359362

360-
### ![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)
363+
### ![ru__RU](https://img.shields.io/badge/ru__RU-99.75%25-yellow)
364+
365+
<details>
366+
<summary>Missing keys in ru_RU.axaml</summary>
367+
368+
- Text.Checkout.WithFastForward
369+
- Text.Checkout.WithFastForward.Upstream
370+
371+
</details>
361372

362-
### ![ta__IN](https://img.shields.io/badge/ta__IN-92.13%25-yellow)
373+
### ![ta__IN](https://img.shields.io/badge/ta__IN-91.91%25-yellow)
363374

364375
<details>
365376
<summary>Missing keys in ta_IN.axaml</summary>
@@ -375,6 +386,8 @@ This document shows the translation status of each locale file in the repository
375386
- Text.BranchCM.CompareWithCurrent
376387
- Text.BranchCM.ResetToSelectedCommit
377388
- Text.Checkout.RecurseSubmodules
389+
- Text.Checkout.WithFastForward
390+
- Text.Checkout.WithFastForward.Upstream
378391
- Text.CommitCM.CopyAuthor
379392
- Text.CommitCM.CopyCommitter
380393
- Text.CommitCM.CopySubject
@@ -430,7 +443,7 @@ This document shows the translation status of each locale file in the repository
430443

431444
</details>
432445

433-
### ![uk__UA](https://img.shields.io/badge/uk__UA-93.38%25-yellow)
446+
### ![uk__UA](https://img.shields.io/badge/uk__UA-93.15%25-yellow)
434447

435448
<details>
436449
<summary>Missing keys in uk_UA.axaml</summary>
@@ -445,6 +458,8 @@ This document shows the translation status of each locale file in the repository
445458
- Text.Bisect.WaitingForRange
446459
- Text.BranchCM.ResetToSelectedCommit
447460
- Text.Checkout.RecurseSubmodules
461+
- Text.Checkout.WithFastForward
462+
- Text.Checkout.WithFastForward.Upstream
448463
- Text.CommitCM.CopyAuthor
449464
- Text.CommitCM.CopyCommitter
450465
- Text.CommitCM.CopySubject

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.21
1+
2025.22

src/App.axaml.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public static async Task<string> GetClipboardTextAsync()
301301
return await clipboard.GetTextAsync();
302302
}
303303
}
304-
return default;
304+
return null;
305305
}
306306

307307
public static string Text(string key, params object[] args)
@@ -323,8 +323,7 @@ public static Avalonia.Controls.Shapes.Path CreateMenuIcon(string key)
323323
icon.Height = 12;
324324
icon.Stretch = Stretch.Uniform;
325325

326-
var geo = Current?.FindResource(key) as StreamGeometry;
327-
if (geo != null)
326+
if (Current?.FindResource(key) is StreamGeometry geo)
328327
icon.Data = geo;
329328

330329
return icon;
@@ -682,8 +681,7 @@ private string FixFontFamilyName(string input)
682681
}
683682

684683
var name = sb.ToString();
685-
var idx = name.IndexOf('#');
686-
if (idx >= 0)
684+
if (name.Contains('#', StringComparison.Ordinal))
687685
{
688686
if (!name.Equals("fonts:Inter#Inter", StringComparison.Ordinal) &&
689687
!name.Equals("fonts:SourceGit#JetBrains Mono", StringComparison.Ordinal))

src/Commands/Blame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Models.BlameData Result()
5151

5252
private void ParseLine(string line)
5353
{
54-
if (line.IndexOf('\0', StringComparison.Ordinal) >= 0)
54+
if (line.Contains('\0', StringComparison.Ordinal))
5555
{
5656
_result.IsBinary = true;
5757
_result.LineInfos.Clear();

src/Commands/Command.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private ProcessStartInfo CreateGitStartInfo()
194194

195195
private void HandleOutput(string line, List<string> errs)
196196
{
197-
line = line ?? string.Empty;
197+
line ??= string.Empty;
198198
Log?.AppendLine(line);
199199

200200
// Lines to hide in error message.

src/Commands/Commit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public bool Run()
3434
return succ;
3535
}
3636

37-
private string _tmpFile = string.Empty;
37+
private readonly string _tmpFile;
3838
}
3939
}

src/Commands/CompareRevisions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public CompareRevisions(string repo, string start, string end, string path)
3939
foreach (var line in lines)
4040
ParseLine(line);
4141

42-
_changes.Sort((l, r) => string.Compare(l.Path, r.Path, StringComparison.Ordinal));
42+
_changes.Sort((l, r) => Models.NumericSort.Compare(l.Path, r.Path));
4343
return _changes;
4444
}
4545

src/Commands/LFS.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public partial class LFS
1010
[GeneratedRegex(@"^(.+)\s+([\w.]+)\s+\w+:(\d+)$")]
1111
private static partial Regex REG_LOCK();
1212

13-
class SubCmd : Command
13+
private class SubCmd : Command
1414
{
1515
public SubCmd(string repo, string args, Models.ICommandLog log)
1616
{

src/Commands/QueryCommitsForInteractiveRebase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ private void ParseParent(string data)
9090

9191
private List<Models.InteractiveCommit> _commits = [];
9292
private Models.InteractiveCommit _current = null;
93-
private string _boundary = "";
93+
private readonly string _boundary;
9494
}
9595
}

src/Commands/QueryFileSize.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ public QueryFileSize(string repo, string file, string revision)
1616

1717
public long Result()
1818
{
19-
if (_result != 0)
20-
return _result;
21-
2219
var rs = ReadToEnd();
2320
if (rs.IsSuccess)
2421
{
@@ -29,7 +26,5 @@ public long Result()
2926

3027
return 0;
3128
}
32-
33-
private readonly long _result = 0;
3429
}
3530
}

src/Commands/UnstageChangesForAmend.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,18 @@ public UnstageChangesForAmend(string repo, List<Models.Change> changes)
2323
_patchBuilder.Append(c.DataForAmend.ObjectHash);
2424
_patchBuilder.Append("\t");
2525
_patchBuilder.Append(c.OriginalPath);
26-
_patchBuilder.Append("\n");
2726
}
2827
else if (c.Index == Models.ChangeState.Added)
2928
{
3029
_patchBuilder.Append("0 0000000000000000000000000000000000000000\t");
3130
_patchBuilder.Append(c.Path);
32-
_patchBuilder.Append("\n");
3331
}
3432
else if (c.Index == Models.ChangeState.Deleted)
3533
{
3634
_patchBuilder.Append("100644 ");
3735
_patchBuilder.Append(c.DataForAmend.ObjectHash);
3836
_patchBuilder.Append("\t");
3937
_patchBuilder.Append(c.Path);
40-
_patchBuilder.Append("\n");
4138
}
4239
else
4340
{
@@ -46,8 +43,9 @@ public UnstageChangesForAmend(string repo, List<Models.Change> changes)
4643
_patchBuilder.Append(c.DataForAmend.ObjectHash);
4744
_patchBuilder.Append("\t");
4845
_patchBuilder.Append(c.Path);
49-
_patchBuilder.Append("\n");
5046
}
47+
48+
_patchBuilder.Append("\n");
5149
}
5250
}
5351

src/Models/AvatarManager.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static AvatarManager Instance
3838
[GeneratedRegex(@"^(?:(\d+)\+)?(.+?)@.+\.github\.com$")]
3939
private static partial Regex REG_GITHUB_USER_EMAIL();
4040

41-
private object _synclock = new object();
41+
private readonly Lock _synclock = new();
4242
private string _storePath;
4343
private List<IAvatarHost> _avatars = new List<IAvatarHost>();
4444
private Dictionary<string, Bitmap> _resources = new Dictionary<string, Bitmap>();
@@ -144,8 +144,7 @@ public Bitmap Request(string email, bool forceRefetch)
144144
if (_defaultAvatars.Contains(email))
145145
return null;
146146

147-
if (_resources.ContainsKey(email))
148-
_resources.Remove(email);
147+
_resources.Remove(email);
149148

150149
var localFile = Path.Combine(_storePath, GetEmailHash(email));
151150
if (File.Exists(localFile))
@@ -179,8 +178,7 @@ public Bitmap Request(string email, bool forceRefetch)
179178

180179
lock (_synclock)
181180
{
182-
if (!_requesting.Contains(email))
183-
_requesting.Add(email);
181+
_requesting.Add(email);
184182
}
185183

186184
return null;
@@ -200,10 +198,7 @@ public void SetFromLocal(string email, string file)
200198
if (image == null)
201199
return;
202200

203-
if (_resources.ContainsKey(email))
204-
_resources[email] = image;
205-
else
206-
_resources.Add(email, image);
201+
_resources[email] = image;
207202

208203
_requesting.Remove(email);
209204

src/Models/Commit.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public enum CommitSearchMethod
1919
public class Commit
2020
{
2121
// As retrieved by: git mktree </dev/null
22-
public static readonly string EmptyTreeSHA1 = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
22+
public const string EmptyTreeSHA1 = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
2323

2424
public static double OpacityForNotMerged
2525
{
@@ -113,7 +113,7 @@ public void ParseDecorators(string data)
113113
if (l.Type != r.Type)
114114
return (int)l.Type - (int)r.Type;
115115
else
116-
return string.Compare(l.Name, r.Name, StringComparison.Ordinal);
116+
return NumericSort.Compare(l.Name, r.Name);
117117
});
118118
}
119119
}

src/Models/CommitTemplate.cs

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

55
namespace SourceGit.Models
66
{
7-
public partial class CommitTemplate : ObservableObject
7+
public class CommitTemplate : ObservableObject
88
{
99
public string Name
1010
{

src/Models/ImageDecoder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public enum ImageDecoder
44
{
55
None = 0,
66
Builtin,
7-
Pfim
7+
Pfim,
8+
Tiff,
89
}
910
}

0 commit comments

Comments
 (0)