From 221e964df0819abeb080dab853ff19f3ff5e2b40 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 21 Jun 2025 10:42:19 +0800 Subject: [PATCH] code_review: PR #1442 Trim both `\` (on Windows) and `/` (on Linux/macOS) characters at the end of path Signed-off-by: leo --- src/Views/AddWorktree.axaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/AddWorktree.axaml.cs b/src/Views/AddWorktree.axaml.cs index 563ed913..8e16642e 100644 --- a/src/Views/AddWorktree.axaml.cs +++ b/src/Views/AddWorktree.axaml.cs @@ -26,7 +26,7 @@ namespace SourceGit.Views { var folder = selected[0]; var folderPath = folder is { Path: { IsAbsoluteUri: true } path } ? path.LocalPath : folder?.Path.ToString(); - TxtLocation.Text = folderPath.TrimEnd('\\'); + TxtLocation.Text = folderPath.TrimEnd(['\\', '/']); } } catch (Exception exception)