mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 21:24:59 +00:00
refactor<*>: rewrite all codes...
This commit is contained in:
parent
89ff8aa744
commit
30ab8ae954
342 changed files with 17208 additions and 19633 deletions
36
src/Models/GitFlow.cs
Normal file
36
src/Models/GitFlow.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
namespace SourceGit.Models {
|
||||
/// <summary>
|
||||
/// GitFlow的分支类型
|
||||
/// </summary>
|
||||
public enum GitFlowBranchType {
|
||||
None,
|
||||
Feature,
|
||||
Release,
|
||||
Hotfix,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GitFlow相关设置
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue