-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Branch struct in package modules/git #33980
base: main
Are you sure you want to change the base?
Conversation
@@ -169,13 +169,6 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u | |||
} | |||
|
|||
if pr.Flow == issues_model.PullRequestFlowAGit { | |||
gitRepo, err := gitrepo.OpenRepository(ctx, pr.BaseRepo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 146 has created gitRepo
.
d537b13
to
c46d935
Compare
@@ -28,8 +28,8 @@ import ( | |||
// Optional - Merger | |||
func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.User) *api.PullRequest { | |||
var ( | |||
baseBranch *git.Branch | |||
headBranch *git.Branch | |||
baseBranch string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
baseBranchName & headBranchName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won’t make that change in this PR because many parts of the codebase are still using Branch as BranchName. It might be better to address this in a future PR to avoid inconsistencies.
The
Branch
struct inmodules/git
package is unnecessary. We can just use astring
to represent a branch