refactor: rewrite git flow init

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-05-20 21:26:41 +08:00
parent 4d5be9f280
commit 3386cb177b
No known key found for this signature in database
3 changed files with 40 additions and 18 deletions

View file

@ -1459,8 +1459,15 @@ namespace SourceGit.ViewModels
init.Icon = App.CreateMenuIcon("Icons.Init");
init.Click += (_, e) =>
{
if (CanCreatePopup())
if (_currentBranch == null)
{
App.RaiseException(_fullpath, "Git flow init failed: No branch found!!!");
}
else if (CanCreatePopup())
{
ShowPopup(new InitGitFlow(this));
}
e.Handled = true;
};
menu.Items.Add(init);