MCPcopy Create free account
hub / github.com/brimdata/super / MergeBranch

Method MergeBranch

db/root.go:380–394  ·  view source on GitHub ↗

MergeBranch merges the indicated branch into its parent returning the commit tag of the new commit into the parent branch.

(ctx context.Context, poolID ksuid.KSUID, childBranch, parentBranch, author, message string)

Source from the content-addressed store, hash-verified

378// MergeBranch merges the indicated branch into its parent returning the
379// commit tag of the new commit into the parent branch.
380func (r *Root) MergeBranch(ctx context.Context, poolID ksuid.KSUID, childBranch, parentBranch, author, message string) (ksuid.KSUID, error) {
381 pool, err := r.OpenPool(ctx, poolID)
382 if err != nil {
383 return ksuid.Nil, err
384 }
385 child, err := pool.OpenBranchByName(ctx, childBranch)
386 if err != nil {
387 return ksuid.Nil, err
388 }
389 parent, err := pool.OpenBranchByName(ctx, parentBranch)
390 if err != nil {
391 return ksuid.Nil, err
392 }
393 return child.mergeInto(ctx, parent, author, message)
394}
395
396func (r *Root) Revert(ctx context.Context, poolID ksuid.KSUID, branchName string, commitID ksuid.KSUID, author, message string) (ksuid.KSUID, error) {
397 pool, err := r.OpenPool(ctx, poolID)

Callers

nothing calls this directly

Calls 3

OpenPoolMethod · 0.95
OpenBranchByNameMethod · 0.80
mergeIntoMethod · 0.80

Tested by

no test coverage detected