mirror of
https://github.com/harness/drone.git
synced 2025-05-05 15:32:56 +00:00
fix: [CODE-3280] update target ref in pr compare path (#3720)
* fix: [CODE-3280] update target ref in pr compare path
This commit is contained in:
parent
a73113f8e6
commit
0ba7be95fd
@ -50,7 +50,10 @@ export const RevertPRButton: React.FC<RevertPRButtonProps> = ({ pullRequestMetad
|
||||
history.push(
|
||||
routes.toCODECompare({
|
||||
repoPath: repoMetadata?.path as string,
|
||||
diffRefs: makeDiffRefs(pullRequestMetadata?.target_branch as string, data.branch)
|
||||
diffRefs: makeDiffRefs(
|
||||
(pullRequestMetadata?.target_branch ?? repoMetadata?.default_branch) as string,
|
||||
data.branch
|
||||
)
|
||||
})
|
||||
)
|
||||
showSuccess(getString('pr.revertBranchSuccess', { branch: data.branch }), 3000)
|
||||
@ -63,7 +66,10 @@ export const RevertPRButton: React.FC<RevertPRButtonProps> = ({ pullRequestMetad
|
||||
history.push(
|
||||
routes.toCODECompare({
|
||||
repoPath: repoMetadata?.path as string,
|
||||
diffRefs: makeDiffRefs(pullRequestMetadata?.target_branch as string, branchName)
|
||||
diffRefs: makeDiffRefs(
|
||||
(pullRequestMetadata?.target_branch ?? repoMetadata?.default_branch) as string,
|
||||
branchName
|
||||
)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ export function FileContent({
|
||||
history.replace(
|
||||
routes.toCODECompare({
|
||||
repoPath: repoMetadata.path as string,
|
||||
diffRefs: makeDiffRefs(repoMetadata?.default_branch as string, newBranch)
|
||||
diffRefs: makeDiffRefs((gitRef ?? repoMetadata?.default_branch) as string, newBranch)
|
||||
})
|
||||
)
|
||||
} else {
|
||||
|
@ -247,7 +247,7 @@ function Editor({ resourceContent, repoMetadata, gitRef, resourcePath, isReposit
|
||||
history.replace(
|
||||
routes.toCODECompare({
|
||||
repoPath: repoMetadata.path as string,
|
||||
diffRefs: makeDiffRefs(repoMetadata?.default_branch as string, newBranch)
|
||||
diffRefs: makeDiffRefs((gitRef ?? repoMetadata?.default_branch) as string, newBranch)
|
||||
})
|
||||
)
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user