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
@@ -21,6 +21,18 @@ import Testing
#expect(state.fileDiffs["a.txt"]?.isTooBig == false)
}
@Test("a merge conflict is not counted as staged")
func conflictIsNotStaged() {
let state = GitDerivation.derive(GitSnapshot(branch: "main", ahead: 0, canPush: false, changes: [
change("both.txt", .unmerged, staged: false, "a\n", "<<<<<<< HEAD\na\n=======\nb\n>>>>>>> topic\n"),
change("ready.txt", .modified, staged: true, "1\n", "2\n"),
]))
#expect(state.stagedCount == 1)
#expect(state.unstagedCount == 1)
#expect(state.stagedPaths == ["ready.txt"])
#expect(state.unstagedPaths == ["both.txt"])
}
@Test("behind and upstream pass through from the snapshot")
func behindAndUpstream() {
let state = GitDerivation.derive(GitSnapshot(branch: "main", ahead: 1, canPush: true, behind: 2, upstream: "origin/main", changes: []))