From 8dfe882455d3d4981ebe57b65f88ae624342a66f Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 28 Jun 2024 09:37:43 +0800 Subject: [PATCH] enhance: use `-B` instead of `-b` to support creating worktree with existed branch (#205) --- src/Commands/Worktree.cs | 2 +- src/Views/Launcher.axaml.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/Worktree.cs b/src/Commands/Worktree.cs index 800cb309..31814427 100644 --- a/src/Commands/Worktree.cs +++ b/src/Commands/Worktree.cs @@ -70,7 +70,7 @@ namespace SourceGit.Commands Args += "--track "; if (!string.IsNullOrEmpty(name)) - Args += $"-b {name} "; + Args += $"-B {name} "; Args += $"\"{fullpath}\" "; diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index f53f7a40..fd67ecda 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -11,8 +11,6 @@ namespace SourceGit.Views { public Launcher() { - InitializeComponent(); - var layout = ViewModels.Preference.Instance.Layout; WindowState = layout.LauncherWindowState; @@ -21,6 +19,8 @@ namespace SourceGit.Views Width = layout.LauncherWidth; Height = layout.LauncherHeight; } + + InitializeComponent(); } protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)