Skip to content

Commit c49eda0

Browse files
gregorrieglerdzanottosrecnigharaldreingruberMichael-bit-224
committed
done pulls if already done
Co-authored-by: Dario Zanotto <d.zanotto@gmail.com> Co-authored-by: Martin Sereinig <ms@veryunited.net> Co-authored-by: Harald Reingruber <harald.reingruber@gmail.com> Co-authored-by: Michael Weichselbaumer <02.angeln-statuten@icloud.com> Co-authored-by: Ricardo Colombo <clmb.olv@gmail.com> Co-authored-by: Bernadette Hammerle <bernadette.elena.hammerle@gmail.com>
1 parent d292a91 commit c49eda0

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

mob.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,7 @@ func done(configuration config.Configuration) {
971971
} else {
972972
git("checkout", baseBranch.Name)
973973
git("branch", "-D", wipBranch.Name)
974+
git("pull", "--ff-only")
974975
say.Info("someone else already ended your session")
975976
}
976977
}

mob_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,27 @@ func TestDoneSquashWipStartCommit(t *testing.T) {
16951695
assertCommitsOnBranch(t, 1, "master")
16961696
}
16971697

1698+
func TestDonePullsIfAlreadyDone(t *testing.T) {
1699+
_, configuration := setup(t)
1700+
configuration.NextStay = true
1701+
1702+
setWorkingDir(tempDir + "/bob")
1703+
start(configuration)
1704+
createFile(t, "example.txt", "contentIrrelevant")
1705+
next(configuration)
1706+
1707+
setWorkingDir(tempDir + "/alice")
1708+
start(configuration)
1709+
done(configuration)
1710+
git("commit", "-am", "\"mob done by Alice\"")
1711+
git("push")
1712+
1713+
setWorkingDir(tempDir + "/bob")
1714+
done(configuration)
1715+
1716+
assertFileExist(t, "example.txt")
1717+
}
1718+
16981719
func TestDoneNoSquashStartCommit(t *testing.T) {
16991720
_, configuration := setup(t)
17001721
configuration.NextStay = true

0 commit comments

Comments
 (0)