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