Skip to content

Commit

Permalink
Merge pull request #569 from atenart/mr-create-target-remote
Browse files Browse the repository at this point in the history
mr_create: fix the target remote
  • Loading branch information
bmeneg authored Jan 22, 2021
2 parents e67df2b + 7c7f840 commit 910234a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/mr_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func runMRCreate(cmd *cobra.Command, args []string) {
title, body = msgs[0], strings.Join(msgs[1:], "\n\n")
} else {
coverLetterFormat, _ := cmd.Flags().GetBool("cover-letter")
msg, err := mrText(targetBranch, branch, sourceRemote, forkedFromRemote, coverLetterFormat)
msg, err := mrText(targetBranch, branch, sourceRemote, targetRemote, coverLetterFormat)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -286,12 +286,12 @@ func determineSourceRemote(branch string) string {
return forkRemote
}

func mrText(base, head, sourceRemote, forkedFromRemote string, coverLetterFormat bool) (string, error) {
func mrText(base, head, sourceRemote, targetRemote string, coverLetterFormat bool) (string, error) {
var (
commitMsg string
err error
)
remoteBase := fmt.Sprintf("%s/%s", forkedFromRemote, base)
remoteBase := fmt.Sprintf("%s/%s", targetRemote, base)
commitMsg = ""
if git.NumberCommits(remoteBase, head) == 1 {
commitMsg, err = git.LastCommitMessage()
Expand Down Expand Up @@ -344,7 +344,7 @@ func mrText(base, head, sourceRemote, forkedFromRemote string, coverLetterFormat
InitMsg: commitMsg,
Tmpl: mrTmpl,
CommentChar: commentChar,
Base: forkedFromRemote + ":" + base,
Base: targetRemote + ":" + base,
Head: sourceRemote + ":" + head,
CommitLogs: commitLogs,
}
Expand Down

0 comments on commit 910234a

Please sign in to comment.