MCPcopy Index your code
hub / github.com/rilldata/rill / MergeWithStrategy

Function MergeWithStrategy

runtime/pkg/gitutil/gitcmdwrapper.go:70–88  ·  view source on GitHub ↗

MergeWithStrategy merge a branch into the current branch using the specified strategy.

(path, branch, strategy string)

Source from the content-addressed store, hash-verified

68
69// MergeWithStrategy merge a branch into the current branch using the specified strategy.
70func MergeWithStrategy(path, branch, strategy string) error {
71 var args []string
72 switch strategy {
73 case "theirs":
74 args = []string{"merge", "-X", "theirs", branch}
75 case "ours":
76 args = []string{"merge", "-X", "ours", branch}
77 case "":
78 args = []string{"merge", branch}
79 default:
80 return fmt.Errorf("internal error: unsupported merge strategy: %s", strategy)
81 }
82
83 _, err := Run(context.Background(), path, args...)
84 if err != nil {
85 return err
86 }
87 return nil
88}
89
90// MergeWithBailOnConflict attempts to merge a branch into the current branch and aborts if there are conflicts.
91// Returns true if merge was successful, false if there were conflicts (but abort succeeded).

Callers 4

pullInnerMethod · 0.92
commitToDefaultBranchMethod · 0.92
mergeToBranchMethod · 0.92
TestMergeWithStrategyFunction · 0.85

Calls 2

RunFunction · 0.70
ErrorfMethod · 0.65

Tested by 1

TestMergeWithStrategyFunction · 0.68