git-roast/internal/roast/request.go
2025-01-05 06:30:54 +01:00

32 lines
596 B
Go

package roast
import (
"errors"
"fmt"
"git-roast/internal/log"
)
func (r *Roast) Request(from string, into string) error {
log.Debugf("requesting merge from %s into %s\n", from, into)
sourceBranch, err := r.repo.Branch(from)
if err != nil {
return errors.Join(fmt.Errorf("failed to get source branch %s", from), err)
}
targetBranch, err := r.repo.Branch(into)
if err != nil {
return errors.Join(fmt.Errorf("failed to get target branch %s", from), err)
}
id := fmt.Sprintf(
"from_%s_into_%s",
sourceBranch.Remote,
targetBranch.Remote,
)
fmt.Println(id)
return nil
}