@@ -78,6 +78,29 @@ def test_abbreviated_commit_link_resolves_to_full_blame_sha(self, ec_repo, ec_db
7878 assert result ["annotations" ][0 ].commit_sha == full_sha
7979 assert result ["annotations" ][0 ].decision_id == decision ["id" ]
8080
81+ def test_uppercase_abbreviated_commit_link_is_normalized (self , ec_repo , ec_db ):
82+ full_sha = _commit (ec_repo , "uppercase.py" , "line1\n " , "commit with uppercase link" )
83+ decision = create_decision (ec_db , title = "Uppercase SHA decision" )
84+ link_decision_to_commit (ec_db , decision ["id" ], full_sha [:8 ].upper ())
85+
86+ result = annotate_file (ec_db , str (ec_repo ), "uppercase.py" )
87+
88+ assert result ["annotated_sha_count" ] == 1
89+ assert result ["annotations" ][0 ].commit_sha == full_sha
90+ assert result ["annotations" ][0 ].decision_id == decision ["id" ]
91+
92+ def test_equivalent_full_and_abbreviated_links_are_deduplicated (self , ec_repo , ec_db ):
93+ full_sha = _commit (ec_repo , "duplicate.py" , "line1\n " , "commit with duplicate links" )
94+ decision = create_decision (ec_db , title = "One decision, two link forms" )
95+ link_decision_to_commit (ec_db , decision ["id" ], full_sha )
96+ link_decision_to_commit (ec_db , decision ["id" ], full_sha [:8 ])
97+
98+ result = annotate_file (ec_db , str (ec_repo ), "duplicate.py" )
99+
100+ assert result ["annotated_sha_count" ] == 1
101+ assert len (result ["annotations" ]) == 1
102+ assert result ["annotations" ][0 ].decision_id == decision ["id" ]
103+
81104 def test_happy_single_decision (self , ec_repo , ec_db ):
82105 sha1 = _commit (ec_repo , "foo.py" , "line1\n line2\n " , "commit 1" )
83106 _commit (ec_repo , "foo.py" , "line1\n line2\n line3\n line4\n " , "commit 2" )
0 commit comments