Speed up commit lookups for merge requests
authorMarius Mathiesen <marius@gitorious.org>
Fri, 7 Dec 2012 11:17:28 +0000 (12:17 +0100)
committerMarius Mathiesen <marius@gitorious.org>
Fri, 7 Dec 2012 11:17:28 +0000 (12:17 +0100)
commita46b76ddc1347da4fa82599ed1292e7e96557fa9
tree245d7ef4413a43e79d69ed6a0823418d7e37fb2c
parentdadf871ecece164b84d6021e689ef2d1e7efece4
Speed up commit lookups for merge requests

Before this commit, Gitorious would calculate a commit delta between
two repositories, which takes a long time. Since the source repository
already contains all the commits, we look them up from the same
repository (a straight `git log`), which speeds up the lookup by a
significant factor:

Loading the commits for a merge request introducing a single new
commit changed from ~1100ms to ~100ms on a test machine.
app/models/merge_request.rb
app/models/merge_request_version.rb
test/functional/merge_requests_controller_test.rb
test/unit/merge_request_test.rb