Skip to content

Commit

Permalink
done pulls if already done
Browse files Browse the repository at this point in the history
Co-authored-by: Dario Zanotto <[email protected]>
Co-authored-by: Martin Sereinig <[email protected]>
Co-authored-by: Harald Reingruber <[email protected]>
Co-authored-by: Michael Weichselbaumer <[email protected]>
Co-authored-by: Ricardo Colombo <[email protected]>
Co-authored-by: Bernadette Hammerle <[email protected]>
  • Loading branch information
7 people committed Sep 20, 2024
1 parent d292a91 commit c49eda0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions mob.go
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ func done(configuration config.Configuration) {
} else {
git("checkout", baseBranch.Name)
git("branch", "-D", wipBranch.Name)
git("pull", "--ff-only")
say.Info("someone else already ended your session")
}
}
Expand Down
21 changes: 21 additions & 0 deletions mob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,27 @@ func TestDoneSquashWipStartCommit(t *testing.T) {
assertCommitsOnBranch(t, 1, "master")
}

func TestDonePullsIfAlreadyDone(t *testing.T) {
_, configuration := setup(t)
configuration.NextStay = true

setWorkingDir(tempDir + "/bob")
start(configuration)
createFile(t, "example.txt", "contentIrrelevant")
next(configuration)

setWorkingDir(tempDir + "/alice")
start(configuration)
done(configuration)
git("commit", "-am", "\"mob done by Alice\"")
git("push")

setWorkingDir(tempDir + "/bob")
done(configuration)

assertFileExist(t, "example.txt")
}

func TestDoneNoSquashStartCommit(t *testing.T) {
_, configuration := setup(t)
configuration.NextStay = true
Expand Down

0 comments on commit c49eda0

Please sign in to comment.