Project

General

Profile

Patch #42762 » 0002-Change-the-way-commits-are-indexed-for-revision-grap.patch

Go MAEDA, 2025-12-25 11:13

View differences:

app/helpers/repositories_helper.rb
}
end
heads.sort_by!(&:to_s)
space = nil
# Process commits starting from the latest
space = index_head(0, commits.first, commits_by_scmid)
# Process commits from heads
heads.each do |head|
if commits_by_scmid.include?(head.scmid) && commits_by_scmid[head.scmid][:space].nil?
space = index_head((space || -1) + 1, head, commits_by_scmid)
space = index_head(space + 1, head, commits_by_scmid)
end
end
# when no head matched anything use first commit
space ||= index_head(0, commits.first, commits_by_scmid)
# Process orphan commits
while (commit = commits.find { |commit| commits_by_scmid[commit.scmid][:space].nil? })
space = index_head(space + 1, commit, commits_by_scmid)
end
return commits_by_scmid, space
end
(13-13/18)