style: add .editorconfig for code formatting. see issu #25

This commit is contained in:
leo 2024-03-18 09:37:06 +08:00
parent a8eeea4f78
commit 18aaa0a143
225 changed files with 7781 additions and 3911 deletions

View file

@ -1,38 +1,45 @@
using System.Threading.Tasks;
namespace SourceGit.ViewModels {
public class GitFlowFinish : Popup {
namespace SourceGit.ViewModels
{
public class GitFlowFinish : Popup
{
public Models.Branch Branch => _branch;
public bool IsFeature => _type == Models.GitFlowBranchType.Feature;
public bool IsRelease => _type == Models.GitFlowBranchType.Release;
public bool IsHotfix => _type == Models.GitFlowBranchType.Hotfix;
public bool KeepBranch {
public bool KeepBranch
{
get;
set;
} = false;
public GitFlowFinish(Repository repo, Models.Branch branch, Models.GitFlowBranchType type) {
public GitFlowFinish(Repository repo, Models.Branch branch, Models.GitFlowBranchType type)
{
_repo = repo;
_branch = branch;
_type = type;
View = new Views.GitFlowFinish() { DataContext = this };
}
public override Task<bool> Sure() {
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
return Task.Run(() => {
return Task.Run(() =>
{
var branch = _branch.Name;
switch (_type) {
case Models.GitFlowBranchType.Feature:
branch = branch.Substring(_repo.GitFlow.Feature.Length);
break;
case Models.GitFlowBranchType.Release:
branch = branch.Substring(_repo.GitFlow.Release.Length);
break;
default:
branch = branch.Substring(_repo.GitFlow.Hotfix.Length);
break;
switch (_type)
{
case Models.GitFlowBranchType.Feature:
branch = branch.Substring(_repo.GitFlow.Feature.Length);
break;
case Models.GitFlowBranchType.Release:
branch = branch.Substring(_repo.GitFlow.Release.Length);
break;
default:
branch = branch.Substring(_repo.GitFlow.Hotfix.Length);
break;
}
var succ = new Commands.GitFlow(_repo.FullPath).Finish(_type, branch, KeepBranch);
@ -41,8 +48,8 @@ namespace SourceGit.ViewModels {
});
}
private Repository _repo = null;
private Models.Branch _branch = null;
private Models.GitFlowBranchType _type = Models.GitFlowBranchType.None;
private readonly Repository _repo = null;
private readonly Models.Branch _branch = null;
private readonly Models.GitFlowBranchType _type = Models.GitFlowBranchType.None;
}
}
}