From 15704c0a75aa8e174597ecc0ef2c6f80151808ce Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 9 Apr 2025 08:49:31 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E9=A1=B9=E7=9B=AE=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=97=B6=E4=BF=AE=E6=AD=A3=E9=BB=98=E8=AE=A4=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index d29d41ac0..f5130e30c 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -37,6 +37,10 @@ class RepositoriesController < ApplicationController @fork_project = Project.find_by(id: @project_fork_id) @fork_project_user = @fork_project.owner end + # 修正默认分支 + if @result[:repo].present? && @result[:repo]['default_branch'].present? && @result[:repo]['default_branch'] != @project.default_branch + @project.update_column('default_branch', @result[:repo]['default_branch']) + end rescue Exception => e uid_logger_error(e.message) tip_exception(e.message)