Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-07-07 02:28:13 +0300
committerDouwe Maan <douwe@selenight.nl>2016-07-07 02:28:13 +0300
commit228d2a4cb1943c4eda751f80990eed06a3875864 (patch)
tree402ec01514399a54f51688474ee855c1a30c6782 /app
parentd9c75aec3adf23428e4c85a21ce2c357da006b6c (diff)
Add some more code comments.
Diffstat (limited to 'app')
-rw-r--r--app/models/concerns/note_on_diff.rb1
-rw-r--r--app/models/merge_request.rb5
2 files changed, 4 insertions, 2 deletions
diff --git a/app/models/concerns/note_on_diff.rb b/app/models/concerns/note_on_diff.rb
index b511f33b8fa..6d8b9b76c84 100644
--- a/app/models/concerns/note_on_diff.rb
+++ b/app/models/concerns/note_on_diff.rb
@@ -31,6 +31,7 @@ module NoteOnDiff
false
end
+ # Returns an array of at most 16 highlighted lines above a diff note
def truncated_diff_lines
prev_match_line = nil
prev_lines = []
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 4624e9d36e9..ed99142902e 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -186,8 +186,9 @@ class MergeRequest < ActiveRecord::Base
# This will not be the actual base commit if the target branch was merged into
# the source branch after the merge request was created, but it is good enough
# for the specific purpose of linking to a commit.
- # It is not good enough for use in Gitlab::Git::DiffRefs, which need the
- # true base commit.
+ # It is not good enough for use in `Gitlab::Git::DiffRefs`, which needs the
+ # true base commit, so we can't simply have `#diff_base_commit` fall back on
+ # this method.
def likely_diff_base_commit
first_commit.parent || first_commit
end