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:
parent
62db642312
commit
8a081ac5db
1 changed files with 22 additions and 15 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue