diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-03-27 10:34:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-27 02:34:10 +0000 |
commit | 538790ad1db8bf66942ff2ead4ef78df5ab8b702 (patch) | |
tree | 20f455eda554c8e14e557ee31d13f58edd7b3213 /routers/private | |
parent | f47e00d9d3c3bd58b5944a29c4ff5cec0357520a (diff) | |
download | gitea-538790ad1db8bf66942ff2ead4ef78df5ab8b702.tar.gz gitea-538790ad1db8bf66942ff2ead4ef78df5ab8b702.zip |
Put an edit file button on pull request files to allow a quick operation (#29697)
Resolve #23848
This PR put an edit file button on pull request files to allow a quick
edit for a file. After the edit finished, it will return back to the
viewed file position on pull request files tab.
It also use a branch view file link instead of commit link when it's a
non-commit pull request files view.
<img width="1532" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/3637ca4c-89d5-4621-847b-79702a44f617">
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'routers/private')
-rw-r--r-- | routers/private/hook_post_receive.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/private/hook_post_receive.go b/routers/private/hook_post_receive.go index a09956f738..101ae92302 100644 --- a/routers/private/hook_post_receive.go +++ b/routers/private/hook_post_receive.go @@ -20,6 +20,7 @@ import ( "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/modules/web" gitea_context "code.gitea.io/gitea/services/context" + pull_service "code.gitea.io/gitea/services/pull" repo_service "code.gitea.io/gitea/services/repository" ) @@ -109,6 +110,9 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) { } } else { branchesToSync = append(branchesToSync, update) + + // TODO: should we return the error and return the error when pushing? Currently it will log the error and not prevent the pushing + pull_service.UpdatePullsRefs(ctx, repo, update) } } if len(branchesToSync) > 0 { |