improves the git feature by adding a conflict status
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user