Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,15 @@ internal class BranchTrack(
val parentSha = vc.getSha(parent)

stackManager.trackBranch(branchName, parent, parentSha)

printStatic(
buildAnnotatedString {
append("Branch ")
branch { append(branchName) }
append(" is now tracked with parent branch ")
branch { append(parent) }
append(".")
}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class BranchTrackTest {
gitCommit("Change A")

testCommand({ branchTrack(null) }) {
awaitFrame("")
awaitFrame(static = "Branch change-a is now tracked with parent branch main.", output = "")
assertThat(awaitResult()).isTrue()
}

Expand Down Expand Up @@ -90,7 +90,9 @@ class BranchTrackTest {
testCommand({ repoInit("main", Optional.None) })
gitCreateAndCheckoutBranch("change-a")
val parentSha = gitCommit("Change A")
testCommand({ branchTrack(null) })
testCommand({ branchTrack(null) }) {
awaitFrame(static = "Branch change-a is now tracked with parent branch main.", output = "")
}
gitCreateAndCheckoutBranch("change-b")
gitCommit("Change B")

Expand All @@ -107,7 +109,15 @@ class BranchTrackTest {
sendKeyEvent(KeyEvent("ArrowUp"))
sendKeyEvent(KeyEvent("Enter"))

awaitFrame(static = "Choose a parent branch for change-b: change-a", output = "")
awaitFrame(
static =
"""
Choose a parent branch for change-b: change-a
Branch change-b is now tracked with parent branch change-a.
"""
.trimIndent(),
output = "",
)

assertThat(awaitResult()).isTrue()
}
Expand Down Expand Up @@ -147,13 +157,15 @@ class BranchTrackTest {
testCommand({ repoInit("main", Optional.None) })
gitCreateAndCheckoutBranch("change-a")
gitCommit("Change A")
testCommand({ branchTrack(null) })
testCommand({ branchTrack(null) }) {
awaitFrame(static = "Branch change-a is now tracked with parent branch main.", output = "")
}
gitCheckoutBranch("main")
gitCreateAndCheckoutBranch("change-b")
gitCommit("Change B")

testCommand({ branchTrack(null) }) {
awaitFrame("")
awaitFrame(static = "Branch change-b is now tracked with parent branch main.", output = "")
assertThat(awaitResult()).isTrue()
}

Expand Down