Refactor more code around commit button text (#25990)
Missed this when doing https://github.com/zed-industries/zed/pull/25988 Release Notes: - N/A
This commit is contained in:
parent
88940732ca
commit
ffe2bed1e2
2 changed files with 2 additions and 13 deletions
|
@ -262,11 +262,7 @@ impl CommitModal {
|
||||||
.map(|b| b.name.clone())
|
.map(|b| b.name.clone())
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| "<no branch>".into());
|
.unwrap_or_else(|| "<no branch>".into());
|
||||||
let tooltip = if git_panel.has_staged_changes() {
|
let (_, tooltip) = git_panel.configure_commit_button(cx);
|
||||||
"Commit staged changes"
|
|
||||||
} else {
|
|
||||||
"Commit changes to tracked files"
|
|
||||||
};
|
|
||||||
let title = git_panel.commit_button_title();
|
let title = git_panel.commit_button_title();
|
||||||
let co_authors = git_panel.render_co_authors(cx);
|
let co_authors = git_panel.render_co_authors(cx);
|
||||||
(branch, tooltip, title, co_authors)
|
(branch, tooltip, title, co_authors)
|
||||||
|
|
|
@ -1974,14 +1974,7 @@ impl GitPanel {
|
||||||
} else if !self.has_write_access(cx) {
|
} else if !self.has_write_access(cx) {
|
||||||
(false, "You do not have write access to this project")
|
(false, "You do not have write access to this project")
|
||||||
} else {
|
} else {
|
||||||
(
|
(true, self.commit_button_title())
|
||||||
true,
|
|
||||||
if self.has_staged_changes() {
|
|
||||||
"Commit"
|
|
||||||
} else {
|
|
||||||
"Commit Tracked"
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue