summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-05-17 08:12:33 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-05-17 08:12:33 +0000
commit48877dfc7e9579674e8b768cc69c7bf2ef40bace (patch)
tree9dbc77848cce6749c2c6e514f795d303203f93dc /lib
parent2f7e0aba2fec30be86f2f6048fdb50e93b4365c8 (diff)
parentdfdd88151092fde3e32729dd466ad9ba44e158c6 (diff)
downloadgitlab-ce-48877dfc7e9579674e8b768cc69c7bf2ef40bace.tar.gz
Merge branch 'zj-workhorse-commit-patch-diff' into 'master'
Workhorse to send raw diff and patch for commits Closes gitaly#1196 See merge request gitlab-org/gitlab-ce!18974
Diffstat (limited to 'lib')
-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.