fixed 项目查询时修正默认分支

This commit is contained in:
xxq250 2025-04-09 08:49:31 +08:00
parent ef214af00a
commit 15704c0a75
1 changed files with 4 additions and 0 deletions

View File

@ -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)