improves the git feature by adding a conflict status

This commit is contained in:
2026-10-30 16:47:34 +01:00
parent caec81e762
commit 0278d7fbd1
14 changed files with 10927 additions and 19 deletions
@@ -32,6 +32,14 @@ import Testing
#expect(GitSections.build([row("x", status, staged: false)]).map(\.kind) == [.changed])
}
@Test("a merge conflict lands in changed, not staged", arguments: [("U", "U"), ("A", "A"), ("D", "D")] as [(Character, Character)])
func conflictIsChanged(index: Character, working: Character) {
let rows = Porcelain.classify(index: index, working: working).map { row("both.txt", $0.status, staged: $0.staged) }
let sections = GitSections.build(rows)
#expect(sections.map(\.kind) == [.changed])
#expect(sections[0].rows.map(\.status) == [.unmerged])
}
@Test("empty sections are left out")
func emptySections() {
#expect(GitSections.build([]).isEmpty)