mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
96d4150d26
* remove dotnet-tool.json because the project does not rely on any dotnet tools. * remove Directory.Build.props because the solution has only one project. * move src/SourceGit to src. It's not needed to put all sources into a subfolder of src since there's only one project.
40 lines
1 KiB
C#
40 lines
1 KiB
C#
namespace SourceGit.Models
|
|
{
|
|
public enum GitFlowBranchType
|
|
{
|
|
None,
|
|
Feature,
|
|
Release,
|
|
Hotfix,
|
|
}
|
|
|
|
public class GitFlow
|
|
{
|
|
public string Feature { get; set; }
|
|
public string Release { get; set; }
|
|
public string Hotfix { get; set; }
|
|
|
|
public bool IsEnabled
|
|
{
|
|
get
|
|
{
|
|
return !string.IsNullOrEmpty(Feature)
|
|
&& !string.IsNullOrEmpty(Release)
|
|
&& !string.IsNullOrEmpty(Hotfix);
|
|
}
|
|
}
|
|
|
|
public GitFlowBranchType GetBranchType(string name)
|
|
{
|
|
if (!IsEnabled)
|
|
return GitFlowBranchType.None;
|
|
if (name.StartsWith(Feature))
|
|
return GitFlowBranchType.Feature;
|
|
if (name.StartsWith(Release))
|
|
return GitFlowBranchType.Release;
|
|
if (name.StartsWith(Hotfix))
|
|
return GitFlowBranchType.Hotfix;
|
|
return GitFlowBranchType.None;
|
|
}
|
|
}
|
|
}
|