mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-08 12:25:00 +00:00
ux: show conflict short format in changes view
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
e40ca4bbe0
commit
75015d550c
5 changed files with 64 additions and 62 deletions
|
@ -49,7 +49,10 @@ namespace SourceGit.Models
|
|||
public string OriginalPath { get; set; } = "";
|
||||
public ChangeDataForAmend DataForAmend { get; set; } = null;
|
||||
public ConflictReason ConflictReason { get; set; } = ConflictReason.None;
|
||||
|
||||
public bool IsConflicted => WorkTree == ChangeState.Conflicted;
|
||||
public string ConflictMarker => CONFLICT_MARKERS[(int)ConflictReason];
|
||||
public string ConflictDesc => CONFLICT_DESCS[(int)ConflictReason];
|
||||
|
||||
public void Set(ChangeState index, ChangeState workTree = ChangeState.None)
|
||||
{
|
||||
|
@ -81,5 +84,28 @@ namespace SourceGit.Models
|
|||
if (!string.IsNullOrEmpty(OriginalPath) && OriginalPath[0] == '"')
|
||||
OriginalPath = OriginalPath.Substring(1, OriginalPath.Length - 2);
|
||||
}
|
||||
|
||||
private static readonly string[] CONFLICT_MARKERS =
|
||||
[
|
||||
string.Empty,
|
||||
"DD",
|
||||
"AU",
|
||||
"UD",
|
||||
"UA",
|
||||
"DU",
|
||||
"AA",
|
||||
"UU"
|
||||
];
|
||||
private static readonly string[] CONFLICT_DESCS =
|
||||
[
|
||||
string.Empty,
|
||||
"Both deleted",
|
||||
"Added by us",
|
||||
"Deleted by them",
|
||||
"Added by them",
|
||||
"Deleted by us",
|
||||
"Both added",
|
||||
"Both modified"
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue