Skip to content

Commit 8bd49b0

Browse files
authored
git_ui: Capitalize co-author prefix (zed-industries#23365)
This PR capitalizes the co-author prefix, as this is the way GitHub writes it in their [docs](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line). Release Notes: - N/A
1 parent d0db059 commit 8bd49b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/git_ui/src/git_panel.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ impl GitPanel {
737737
}
738738

739739
fn fill_co_authors(&mut self, _: &FillCoAuthors, cx: &mut ViewContext<Self>) {
740-
const CO_AUTHOR_PREFIX: &str = "co-authored-by: ";
740+
const CO_AUTHOR_PREFIX: &str = "Co-authored-by: ";
741741

742742
let Some(room) = self
743743
.workspace
@@ -749,12 +749,13 @@ impl GitPanel {
749749

750750
let mut existing_text = self.commit_editor.read(cx).text(cx);
751751
existing_text.make_ascii_lowercase();
752+
let lowercase_co_author_prefix = CO_AUTHOR_PREFIX.to_lowercase();
752753
let mut ends_with_co_authors = false;
753754
let existing_co_authors = existing_text
754755
.lines()
755756
.filter_map(|line| {
756757
let line = line.trim();
757-
if line.starts_with(CO_AUTHOR_PREFIX) {
758+
if line.starts_with(&lowercase_co_author_prefix) {
758759
ends_with_co_authors = true;
759760
Some(line)
760761
} else {

0 commit comments

Comments
 (0)