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
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-05-15 18:05:19 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-05-16 12:52:43 +0300
commitdfdd88151092fde3e32729dd466ad9ba44e158c6 (patch)
treea4220116746b4ec58209d37f3b7201ad9d2b0f44 /lib/gitlab
parente8442595746fe529305c70a07c1066bec52ccd31 (diff)
Workhorse to send raw diff and patch for commits
Prior to this change, this was done through unicorn. In theory this could time out. Workhorse has been sending these raw patches and diffs for a long time and is stable in doing so. Added bonus is the fact that `Commit#to_patch` can be removed. `Commit#to_diff` too, which closes https://gitlab.com/gitlab-org/gitaly/issues/324 Closes https://gitlab.com/gitlab-org/gitaly/issues/1196
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/git/commit.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/gitlab/git/commit.rb b/lib/gitlab/git/commit.rb
index fabcd46c8e9..d79a4dbeee4 100644
--- a/lib/gitlab/git/commit.rb
+++ b/lib/gitlab/git/commit.rb
@@ -342,21 +342,6 @@ module Gitlab
parent_ids.first
end
- # Shows the diff between the commit's parent and the commit.
- #
- # Cuts out the header and stats from #to_patch and returns only the diff.
- #
- # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/324
- def to_diff
- Gitlab::GitalyClient.migrate(:commit_patch, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
- if is_enabled
- @repository.gitaly_commit_client.patch(id)
- else
- rugged_diff_from_parent.patch
- end
- end
- end
-
# Returns a diff object for the changes from this commit's first parent.
# If there is no parent, then the diff is between this commit and an
# empty repo. See Repository#diff for keys allowed in the +options+
@@ -432,16 +417,6 @@ module Gitlab
Gitlab::Git::CommitStats.new(@repository, self)
end
- def to_patch(options = {})
- begin
- rugged_commit.to_mbox(options)
- rescue Rugged::InvalidError => ex
- if ex.message =~ /commit \w+ is a merge commit/i
- 'Patch format is not currently supported for merge commits.'
- end
- end
- end
-
# Get ref names collection
#
# Ex.