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

Function mergeInProgress

runtime/pkg/gitutil/gitcmdwrapper.go:117–132  ·  view source on GitHub ↗

mergeInProgress reports whether the repository at path is in the middle of a merge.

(path string)

Source from the content-addressed store, hash-verified

115
116// mergeInProgress reports whether the repository at path is in the middle of a merge.
117func mergeInProgress(path string) (bool, error) {
118 mergeHeadPath, err := Run(context.Background(), path, "rev-parse", "--git-path", "MERGE_HEAD")
119 if err != nil {
120 return false, err
121 }
122 if !filepath.IsAbs(mergeHeadPath) {
123 mergeHeadPath = filepath.Join(path, mergeHeadPath)
124 }
125 if _, err := os.Stat(mergeHeadPath); err != nil {
126 if errors.Is(err, os.ErrNotExist) {
127 return false, nil
128 }
129 return false, err
130 }
131 return true, nil
132}
133
134// CommitAll stages all changes in the working tree and creates a commit with the given message.
135// If pathspec is non-empty, staging and the empty-commit check are scoped to that pathspec.

Callers 1

MergeWithBailOnConflictFunction · 0.85

Calls 2

RunFunction · 0.70
StatMethod · 0.65

Tested by

no test coverage detected