From 2ec46c9da0ecdf6620aa08397fd9566da47bf3f4 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 8 Mar 2024 18:01:29 +0800 Subject: [PATCH] feature: prefer same name if new branch is created based on a remote branch --- src/ViewModels/CreateBranch.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ViewModels/CreateBranch.cs b/src/ViewModels/CreateBranch.cs index 4dd3b5af..291063ac 100644 --- a/src/ViewModels/CreateBranch.cs +++ b/src/ViewModels/CreateBranch.cs @@ -30,6 +30,10 @@ namespace SourceGit.ViewModels { _repo = repo; _baseOnRevision = branch.FullName; + if (!branch.IsLocal && repo.Branches.Find(x => x.IsLocal && x.Name == branch.Name) == null) { + Name = branch.Name; + } + BasedOn = branch; View = new Views.CreateBranch() { DataContext = this }; }