From 5cb03517058a2e42f4b03de69333bb97c2a95bb8 Mon Sep 17 00:00:00 2001 From: Caleb Buxton Date: Wed, 25 Sep 2024 08:25:13 -0700 Subject: [PATCH 1/4] test: improve failure message for ambiguous commits --- test/support/assert_contributor_names.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/support/assert_contributor_names.rb b/test/support/assert_contributor_names.rb index 6d77f54e..6c48aaa6 100644 --- a/test/support/assert_contributor_names.rb +++ b/test/support/assert_contributor_names.rb @@ -6,7 +6,11 @@ module AssertContributorNames def assert_contributor_names(sha1, *contributor_names, **options) begin commit = Commit.new_from_rugged_commit(REPO.repo.lookup(sha1)) - rescue Rugged::OdbError + rescue Rugged::OdbError => e + if e.message == "ambiguous OID prefix - found multiple pack entries" + raise "#{sha1} is ambiguous, please use the full commit SHA" + end + raise "#{sha1} was not found, please make sure the local Rails checkout is up to date" end From 5a20a9503fa2f65630d941041e2f58d788e0e2b9 Mon Sep 17 00:00:00 2001 From: Caleb Buxton Date: Wed, 25 Sep 2024 08:02:52 -0700 Subject: [PATCH 2/4] text: fix failing Evgeny Zislis test --- test/credits/canonical_names_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/credits/canonical_names_test.rb b/test/credits/canonical_names_test.rb index e15fd8a4..69b2a2e8 100644 --- a/test/credits/canonical_names_test.rb +++ b/test/credits/canonical_names_test.rb @@ -1460,7 +1460,7 @@ class CanonicalNamesTest < ActiveSupport::TestCase end test "evgeny.zislis\100gmail.com" do - assert_contributor_names '842ce34', 'Evgeny Zislis' + assert_contributor_names '842ce34bbcfb2d65b04a6e80bf8c168d7c17277d', 'Evgeny Zislis' end test 'f.svehla' do From d0f4ea071560769684bd68fdb12fadba9ad1e996 Mon Sep 17 00:00:00 2001 From: Caleb Buxton Date: Wed, 25 Sep 2024 08:08:20 -0700 Subject: [PATCH 3/4] test: fix failing Jeff Berg test --- test/credits/canonical_names_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/credits/canonical_names_test.rb b/test/credits/canonical_names_test.rb index 69b2a2e8..ab045b98 100644 --- a/test/credits/canonical_names_test.rb +++ b/test/credits/canonical_names_test.rb @@ -2064,7 +2064,7 @@ class CanonicalNamesTest < ActiveSupport::TestCase end test "jeff\100ministrycentered.com" do - assert_contributor_names 'a5991d8', 'Jeff Berg' + assert_contributor_names 'a5991d849175c2ae9b803486f61b610fad9fd87e', 'Jeff Berg' end test "jeff\100opendbms.com" do From 9e0dc21a4405977aac10b5c14b55e9aa039a670a Mon Sep 17 00:00:00 2001 From: Caleb Buxton Date: Mon, 30 Sep 2024 10:25:52 -0700 Subject: [PATCH 4/4] Shorten SHA length to resolve ambiguous OID --- test/credits/canonical_names_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/credits/canonical_names_test.rb b/test/credits/canonical_names_test.rb index ab045b98..a43b160b 100644 --- a/test/credits/canonical_names_test.rb +++ b/test/credits/canonical_names_test.rb @@ -1460,7 +1460,7 @@ class CanonicalNamesTest < ActiveSupport::TestCase end test "evgeny.zislis\100gmail.com" do - assert_contributor_names '842ce34bbcfb2d65b04a6e80bf8c168d7c17277d', 'Evgeny Zislis' + assert_contributor_names '842ce34b', 'Evgeny Zislis' end test 'f.svehla' do @@ -2064,7 +2064,7 @@ class CanonicalNamesTest < ActiveSupport::TestCase end test "jeff\100ministrycentered.com" do - assert_contributor_names 'a5991d849175c2ae9b803486f61b610fad9fd87e', 'Jeff Berg' + assert_contributor_names 'a5991d84', 'Jeff Berg' end test "jeff\100opendbms.com" do