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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2018-07-12 07:19:23 +0300
committerRubén Dávila <ruben@gitlab.com>2018-07-12 07:19:23 +0300
commit249e59e5957ccbf0ccb21bb85eb9232a3dad1fbb (patch)
tree5212eb1c633f958cd81d6b4dc85f9abf75d73909
parent8f5108a6837ca5e92dd28d7928818cdb4f815ece (diff)
Return empty Array if no new changes are found between revsrd-fix-raw-changes-between-method
-rw-r--r--ruby/lib/gitlab/git/repository.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/ruby/lib/gitlab/git/repository.rb b/ruby/lib/gitlab/git/repository.rb
index a8fc54b29..5d4af93f5 100644
--- a/ruby/lib/gitlab/git/repository.rb
+++ b/ruby/lib/gitlab/git/repository.rb
@@ -212,6 +212,7 @@ module Gitlab
@raw_changes_between[[old_rev, new_rev]] ||=
begin
return [] if new_rev.blank? || new_rev == Gitlab::Git::BLANK_SHA
+ return [] unless new_changes_in_rev?(new_rev)
result = []
@@ -231,6 +232,14 @@ module Gitlab
raise Gitlab::Git::Repository::GitError.new(e)
end
+ def new_changes_in_rev?(rev)
+ revs = run_git!(%W[rev-list #{rev} --not --all --objects --max-count=1]).strip
+
+ File.open('/Users/ruben/projects/gdk-ee/gitlab/log.txt', 'w') { |f| f.puts "OUT: #{revs.class}. #{revs.inspect}" }
+
+ revs.present?
+ end
+
def add_tag(tag_name, user:, target:, message: nil)
target_object = Ref.dereference_object(lookup(target))
raise InvalidRef.new("target not found: #{target}") unless target_object