compare: using f_path shouldn't generate full range of commits.

- in case of comparing just 1 file the range of commits is not relevant.
This in addition speeds rendering the compare page by a LOT.
This commit is contained in:
Marcin Kuzminski 2016-12-23 17:39:32 +01:00
parent 62db642312
commit 8a081ac5db

View file

@ -183,6 +183,13 @@ class CompareController(BaseRepoController):
pre_load = ["author", "branch", "date", "message"]
c.ancestor = None
if c.file_path:
if source_commit == target_commit:
c.commit_ranges = []
else:
c.commit_ranges = [target_commit]
else:
try:
c.commit_ranges = source_scm.compare(
source_commit.raw_id, target_commit.raw_id,