Redirect to repositories#show after repository#fetch_changesets to avoid the user-visible browser URL (#39238).

Patch by Holger Just.


git-svn-id: https://svn.redmine.org/redmine/trunk@22414 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2023-10-31 12:45:15 +00:00
parent 146ee1cec4
commit c6fdc7db86
2 changed files with 6 additions and 2 deletions

View File

@@ -103,7 +103,11 @@ class RepositoriesController < ApplicationController
def fetch_changesets
@repository.fetch_changesets if @project.active? && @path.empty? && !Setting.autofetch_changesets?
show
redirect_to(
controller: :repositories, action: :show,
id: @project, repository_id: @repository.identifier_param
)
end
def changes

View File

@@ -237,7 +237,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
role.add_permission! :manage_repository
Repository::Subversion.any_instance.expects(:fetch_changesets).once
post(:fetch_changesets, :params => {:id => 1, :repository_id => 10})
assert_response :success
assert_redirected_to '/projects/ecookbook/repository/10'
role.remove_permission! :manage_repository
Repository::Subversion.any_instance.expects(:fetch_changesets).never