Correctly set comparison first commit when range includes a merge commit
This commit is contained in:
		
							parent
							
								
									264dc3f7dd
								
							
						
					
					
						commit
						24cf6865d3
					
				|  | @ -19,8 +19,8 @@ class Projects::CompareController < Projects::ApplicationController | |||
|     if compare_result | ||||
|       @commits = Commit.decorate(compare_result.commits, @project) | ||||
|       @diffs = compare_result.diffs | ||||
|       @commit = @commits.last | ||||
|       @first_commit = @commits.first | ||||
|       @commit = @project.commit(head_ref) | ||||
|       @first_commit = @project.commit(base_ref) | ||||
|       @line_notes = [] | ||||
|     end | ||||
|   end | ||||
|  |  | |||
|  | @ -171,7 +171,7 @@ module DiffHelper | |||
|   def commit_for_diff(diff) | ||||
|     if diff.deleted_file | ||||
|       first_commit = @first_commit || @commit | ||||
|       first_commit.parent | ||||
|       first_commit.parent || @first_commit | ||||
|     else | ||||
|       @commit | ||||
|     end | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue