lib/gitlab_git/repository.rb in gitlab_git-6.2.2 vs lib/gitlab_git/repository.rb in gitlab_git-6.3.0

- old
+ new

@@ -1,9 +1,9 @@ -# Gitlab::Git::Commit is a wrapper around native Grit::Repository object +# Gitlab::Git::Repository is a wrapper around native Grit::Repository object # We dont want to use grit objects inside app/ # It helps us easily migrate to rugged in future -require_relative 'encoding_herlper' +require_relative 'encoding_helper' require 'tempfile' module Gitlab module Git class Repository @@ -70,10 +70,18 @@ # Returns an Array of Tags def tags rugged.refs.select do |ref| ref.name =~ /\Arefs\/tags/ end.map do |rugged_ref| - Tag.new(rugged_ref.name, rugged_ref.target) + target = rugged_ref.target + message = nil + if rugged_ref.target.is_a?(Rugged::Tag::Annotation) && + rugged_ref.target.target.is_a?(Rugged::Commit) + unless rugged_ref.target.target.message == rugged_ref.target.message + message = rugged_ref.target.message.chomp + end + end + Tag.new(rugged_ref.name, target, message) end.sort_by(&:name) end # Returns an Array of branch and tag names def ref_names