Skip to content

Commit 2503dd7

Browse files
committed
Added casefolding for label name comparisons.
1 parent 98a1cbe commit 2503dd7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

normalize_repos/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __eq__(self, remote):
113113

114114
return all(
115115
[
116-
self.qualified_name == remote.name,
116+
self.qualified_name.casefold() == remote.name.casefold(),
117117
self.color == remote.color,
118118
self.description == remote.description,
119119
]
@@ -129,7 +129,7 @@ def __ne__(self, remote):
129129

130130
return any(
131131
[
132-
self.qualified_name != remote.name,
132+
self.qualified_name.casefold() != remote.name.casefold(),
133133
self.color != remote.color,
134134
self.description != remote.description,
135135
]

normalize_repos/set_labels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def map_repo_to_labels(repo, final_labels, non_destructive=True):
1818
"""
1919

2020
logger.log(logging.INFO, "Fetching initial labels...")
21-
initial_labels = {label.name: label for label in repo.get_labels()}
21+
initial_labels = {label.name.casefold(): label for label in repo.get_labels()}
2222
logger.log(log.SUCCESS, f"done. Found {len(initial_labels)} labels.")
2323

2424
logger.log(logging.INFO, "Parsing final labels...")
25-
final_labels = {label.qualified_name: label for label in final_labels}
25+
final_labels = {label.qualified_name.casefold(): label for label in final_labels}
2626
logger.log(log.SUCCESS, f"done. Found {len(final_labels)} labels.")
2727

2828
if not non_destructive:

0 commit comments

Comments
 (0)