package main import ( "os" "strings" "src.opensuse.org/autogits/common" ) func main() { cwd, err := os.Getwd() if err != nil { common.LogError(err) return } gh, err := common.AllocateGitWorkTree(cwd, "", "") if err != nil { common.LogError(err) return } git, err := gh.ReadExistingPath("") if err != nil { common.LogError(err) return } MergeBase := strings.TrimSpace(git.GitExecWithOutputOrPanic("", "merge-base", "HEAD", "MERGE_HEAD")) status, err := git.GitStatus("") if err != nil { common.LogError(err) return } for _, s := range status { if s.Path == ".gitmodules" && s.Status == common.GitStatus_Unmerged { if err := git.GitResolveSubmoduleFileConflict(s, "", MergeBase, "HEAD", "MERGE_HEAD"); err != nil { common.LogError(err) } } } }