Parent

Gitlab::Git::Compare

Attributes

base[R]
commits[R]
diffs[R]
head[R]
same[R]
timeout[R]

Public Class Methods

new(repository, base, head) click to toggle source
# File lib/gitlab_git/compare.rb, line 6
def initialize(repository, base, head)
  @commits, @diffs = [], []
  @same = false
  @repository = repository
  @timeout = false

  return unless base && head

  @base = Gitlab::Git::Commit.find(repository, base.try(:strip))
  @head = Gitlab::Git::Commit.find(repository, head.try(:strip))

  return unless @base && @head

  if @base.id == @head.id
    @same = true
    return
  end

  @commits = Gitlab::Git::Commit.between(repository, @base.id, @head.id)
end

Public Instance Methods

empty_diff?() click to toggle source

Check if diff is empty because it is actually empty and not because its impossible to get it

# File lib/gitlab_git/compare.rb, line 48
def empty_diff?
  diffs.empty? && timeout == false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.