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
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-01-03 09:52:30 +0300
committerStan Hu <stanhu@gmail.com>2018-01-03 10:48:19 +0300
commit25a868753b4b9e673af31f7f4f58f9e97811e9d9 (patch)
tree66fd90d7696c8e0de4c5dc515f190f9a69e70d0e /spec
parentff077cf7dc5cfd7c6c6206d801ea3f326f7af1aa (diff)
Speed up generation of commit stats by using Rugged native methods
The previous implementation iterated across the entire patch set to determine the number of lines added, deleted, and changed. Rugged has a native method `Rugged::Diff#stat` that does this already, which appears to be a little faster and require less RAM than doing this ourselves. Improves performance in #41524
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/git/commit_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb
index 5ed639543e0..6d35734d306 100644
--- a/spec/lib/gitlab/git/commit_spec.rb
+++ b/spec/lib/gitlab/git/commit_spec.rb
@@ -428,6 +428,11 @@ describe Gitlab::Git::Commit, seed_helper: true do
subject { super().deletions }
it { is_expected.to eq(6) }
end
+
+ describe '#total' do
+ subject { super().total }
+ it { is_expected.to eq(17) }
+ end
end
describe '#stats with gitaly on' do