Skip to content

fix for base correction branch for gh pr create. - #460

Closed
ambareeshb wants to merge 1 commit into
cli:masterfrom
ambareeshb:pr-create-web-base-branch
Closed

fix for base correction branch for gh pr create.#460
ambareeshb wants to merge 1 commit into
cli:masterfrom
ambareeshb:pr-create-web-base-branch

Conversation

@ambareeshb

Copy link
Copy Markdown

Solves #319

Comment thread command/pr_create.go
fmt.Fprintln(cmd.OutOrStdout(), pr.URL)
} else if action == PreviewAction {
var title, body string
if title != "" {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is actually for consistency, we don't wan body=&title= if there is no body and title at all.

Comment thread command/pr_create.go
break
}

isWeb, err := cmd.Flags().GetBool("web")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is moved below, because if its here this can open the web with a different URL. i.e no base branch, which will default to master as base branch.

Comment thread command/pr_create.go

fmt.Fprintln(cmd.OutOrStdout(), pr.URL)
} else if action == PreviewAction {
var title, body string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is shadowing the existing title and body variables, breaking the preview in browser flow. unfortunately the tests didn't catch it.

@vilmibm

vilmibm commented Feb 18, 2020

Copy link
Copy Markdown
Contributor

oh i guess this is being covered in #483 sorry for my confusion

@vilmibm vilmibm closed this Feb 18, 2020
@mislav

mislav commented Feb 19, 2020

Copy link
Copy Markdown
Contributor

@ambareeshb Thank you for your contribution! Because we didn't want any change in functionality bundled with this fix (your approach yields slightly different output, as evident by test changes) and we don't want Compact() in tests (we prefer to do exact string matching), I've made a separate PR with a slightly different approach. 🙇

@ambareeshb

Copy link
Copy Markdown
Author

@ambareeshb Thank you for your contribution! Because we didn't want any change in functionality bundled with this fix (your approach yields slightly different output, as evident by test changes) and we don't want Compact() in tests (we prefer to do exact string matching), I've made a separate PR with a slightly different approach. 🙇

Thank you for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants