2012-09-27 20:59:42 +02:00
|
|
|
class CompareController < ProjectResourceController
|
2012-09-20 21:20:48 +02:00
|
|
|
# Authorize
|
|
|
|
before_filter :authorize_read_project!
|
|
|
|
before_filter :authorize_code_access!
|
|
|
|
before_filter :require_non_empty_project
|
|
|
|
|
2012-09-26 05:10:50 +02:00
|
|
|
def index
|
|
|
|
end
|
|
|
|
|
2012-09-20 21:20:48 +02:00
|
|
|
def show
|
2013-04-01 15:04:35 +02:00
|
|
|
compare = Gitlab::Git::Compare.new(project.repository, params[:from], params[:to])
|
2012-09-20 21:20:48 +02:00
|
|
|
|
2013-04-01 15:04:35 +02:00
|
|
|
@commits = compare.commits
|
|
|
|
@commit = compare.commit
|
|
|
|
@diffs = compare.diffs
|
|
|
|
@refs_are_same = compare.same
|
2012-09-20 21:20:48 +02:00
|
|
|
@line_notes = []
|
|
|
|
end
|
2012-09-26 05:10:50 +02:00
|
|
|
|
|
|
|
def create
|
|
|
|
redirect_to project_compare_path(@project, params[:from], params[:to])
|
|
|
|
end
|
2012-09-20 21:20:48 +02:00
|
|
|
end
|