在创建合并请求时将Gitlab更新到版本7后,我们得到一个比预期大得多的提交列表。当应该有5个时,它提供了1000多个提交的列表。
通过源代码,我无法找到Gitlab确定哪些提交用于合并请求以调试它的位置。我在compare_service.rb
找到了以下内容,但我不知道从哪里开始。
# Compare 2 branches for one repo or between repositories
# and return Gitlab::CompareResult object that responds to commits and diffs
class CompareService
def execute(current_user, source_project, source_branch, target_project, target_branch)
# Try to compare branches to get commits list and diffs
#
# Note: Use satellite only when need to compare between two repos
# because satellites are slower than operations on bare repo
if target_project == source_project
Gitlab::CompareResult.new(
Gitlab::Git::Compare.new(
target_project.repository.raw_repository,
target_branch,
source_branch,
)
)
else
Gitlab::Satellite::CompareAction.new(
current_user,
target_project,
target_branch,
source_project,
source_branch
).result
end
end
end
Gitlab在哪里获取未合并到目标分支的提交的SHA?
答案 0 :(得分:0)
坚固的0.21.0是一个问题。希望这将很快在官方回购中更新,但您可以通过编辑/home/git/gitlab/Gemfile.lock
并搜索坚固的lib来自行修复此问题。将版本从0.21.0更新为0.21.2。
之后运行bundle install:
# MySQL installations (note: the line below states '--without ... postgres')
sudo -u git -H bundle install --without development test postgres --deployment
# PostgreSQL installations (note: the line below states '--without ... mysql')
sudo -u git -H bundle install --without development test mysql --deployment