aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/components/PullRequestMergeForm.vue
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2023-10-25 17:01:31 +0200
committerGitHub <noreply@github.com>2023-10-25 15:01:31 +0000
commit7a286e47532a31ed6abcde3a45da4bad1653a42e (patch)
tree16ec816dee3d7ca088644fc7b101efd9a4c12790 /web_src/js/components/PullRequestMergeForm.vue
parent1eae2aadae0583ab092d6ed857bb727829aa52b7 (diff)
downloadgitea-7a286e47532a31ed6abcde3a45da4bad1653a42e.tar.gz
gitea-7a286e47532a31ed6abcde3a45da4bad1653a42e.zip
Improve pull request command line instructions (#27778)
* Show checkout instructions also when there is no permission to push, for anyone who wants to locally test the changes. * First checkout the branch exactly as is, without immediately having to solve merge conflicts. Leave this to the merge step, since it's often convenient to test a change without worrying about this. * Use `git fetch -u`, so an existing local branch is updated when re-testing the same pull request. But not the more risky `git fetch -f` in to handle force pushes, as we don't want to accidentally overwrite important local changes. * Show different merge command depending on the chosen merge style, interactively updated.
Diffstat (limited to 'web_src/js/components/PullRequestMergeForm.vue')
-rw-r--r--web_src/js/components/PullRequestMergeForm.vue4
1 files changed, 4 insertions, 0 deletions
diff --git a/web_src/js/components/PullRequestMergeForm.vue b/web_src/js/components/PullRequestMergeForm.vue
index 03d1f99683..54dcf9d860 100644
--- a/web_src/js/components/PullRequestMergeForm.vue
+++ b/web_src/js/components/PullRequestMergeForm.vue
@@ -1,5 +1,6 @@
<script>
import {SvgIcon} from '../svg.js';
+import {toggleElem} from '../utils/dom.js';
const {csrfToken, pageData} = window.config;
@@ -39,6 +40,9 @@ export default {
watch: {
mergeStyle(val) {
this.mergeStyleDetail = this.mergeForm.mergeStyles.find((e) => e.name === val);
+ for (const elem of document.querySelectorAll('[data-pull-merge-style]')) {
+ toggleElem(elem, elem.getAttribute('data-pull-merge-style') === val);
+ }
}
},
created() {