diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-05-03 09:29:49 +0000 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-05-04 04:21:12 +0000 |
commit | b44eaf8e0772d4ab076bd0df10b13085483e5e66 (patch) | |
tree | 11cd8ca1fcbe1810de0ee1874302bcf4520af90d /spec/lib/gitlab/git | |
parent | f930c66e2cd55b6760042e775d91df538a4dabf7 (diff) | |
download | gitlab-ce-b44eaf8e0772d4ab076bd0df10b13085483e5e66.tar.gz |
Sort the network graph both by commit date and topographically.30973-network-graph-sorted-by-date-and-topo
- Previously, we sorted commits by date, which seemed to work okay.
- The one edge case where this failed was when multiple commits have the same
commit date (for example: when a range of commits are cherry picked with a
single command, they all have the same commit date [and different author
dates]).
- Commits with the same commit date would be sorted arbitrarily, and usually
break the network graph.
- This commit solves the problem by both sorting by date, and by sorting
topographically (parents aren't displayed until all their children are
displayed)
- Include review comments from @adamniedzielski
A more detailed explanation is present here:
https://gitlab.com/gitlab-org/gitlab-ce/issues/30973#note_28706230
Diffstat (limited to 'spec/lib/gitlab/git')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index ddedb7c3443..fea186fd4f4 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1062,7 +1062,7 @@ describe Gitlab::Git::Repository, seed_helper: true do end it "allows ordering by date" do - expect_any_instance_of(Rugged::Walker).to receive(:sorting).with(Rugged::SORT_DATE) + expect_any_instance_of(Rugged::Walker).to receive(:sorting).with(Rugged::SORT_DATE | Rugged::SORT_TOPO) repository.find_commits(order: :date) end |