// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package tangled

// schema: sh.tangled.git.temp.getMergeBase

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

const (
	GitTempGetMergeBaseNSID = "sh.tangled.git.temp.getMergeBase"
)

// GitTempGetMergeBase_Output is the output of a sh.tangled.git.temp.getMergeBase call.
type GitTempGetMergeBase_Output struct {
	Commit string `json:"commit" cborgen:"commit"`
}

// GitTempGetMergeBase calls the XRPC method "sh.tangled.git.temp.getMergeBase".
//
// base: Ref used to find the common base.
// head: Ref to list history for.
// repo: DID of the repository
func GitTempGetMergeBase(ctx context.Context, c util.LexClient, base string, head string, repo string) (*GitTempGetMergeBase_Output, error) {
	var out GitTempGetMergeBase_Output

	params := map[string]interface{}{}
	params["base"] = base
	params["head"] = head
	params["repo"] = repo
	if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp.getMergeBase", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
