MCPcopy Create free account
hub / github.com/libgit2/git2go / setupRepoForRebase

Function setupRepoForRebase

rebase_test.go:332–357  ·  view source on GitHub ↗

Utils

(repo *Repository, masterCommit, branchName string, commitOpts commitOptions)

Source from the content-addressed store, hash-verified

330
331// Utils
332func 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
359func performRebaseOnto(repo *Repository, branch string, rebaseOpts *RebaseOptions) (*Rebase, error) {
360 master, err := repo.LookupBranch(branch, BranchLocal)

Callers 3

TestRebaseAbortFunction · 0.85
TestRebaseNoConflictsFunction · 0.85
TestRebaseGpgSignedFunction · 0.85

Calls 4

createBranchFunction · 0.85
commitSomethingFunction · 0.85
entryExistsFunction · 0.85
SetHeadMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…