Utils
(repo *Repository, masterCommit, branchName string, commitOpts commitOptions)
| 330 | |
| 331 | // Utils |
| 332 | func setupRepoForRebase(repo *Repository, masterCommit, branchName string, commitOpts commitOptions) error { |
| 333 | // Create a new branch from master |
| 334 | err := createBranch(repo, branchName) |
| 335 | if err != nil { |
| 336 | return err |
| 337 | } |
| 338 | |
| 339 | // Create a commit in master |
| 340 | _, err = commitSomething(repo, masterCommit, masterCommit, commitOpts) |
| 341 | if err != nil { |
| 342 | return err |
| 343 | } |
| 344 | |
| 345 | // Switch to emile |
| 346 | err = repo.SetHead("refs/heads/" + branchName) |
| 347 | if err != nil { |
| 348 | return err |
| 349 | } |
| 350 | |
| 351 | // Check master commit is not in emile branch |
| 352 | if entryExists(repo, masterCommit) { |
| 353 | return errors.New(masterCommit + " entry should not exist in " + branchName + " branch.") |
| 354 | } |
| 355 | |
| 356 | return nil |
| 357 | } |
| 358 | |
| 359 | func performRebaseOnto(repo *Repository, branch string, rebaseOpts *RebaseOptions) (*Rebase, error) { |
| 360 | master, err := repo.LookupBranch(branch, BranchLocal) |
no test coverage detected
searching dependent graphs…