Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/icons/bitbucket.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/codeberg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/forgejo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/gitea.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/gitlab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions crates/git_graph/src/git_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2733,10 +2733,7 @@ impl GitGraph {
})
.when_some(remote.clone(), |this, remote| {
let provider_name = remote.host.name();
let icon = match provider_name.as_str() {
"GitHub" => IconName::Github,
_ => IconName::Link,
};
let icon = git_ui::get_provider_icon(provider_name.as_str());
let parsed_remote = ParsedGitRemote {
owner: remote.owner.as_ref().into(),
repo: remote.repo.as_ref().into(),
Expand Down
5 changes: 1 addition & 4 deletions crates/git_ui/src/commit_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,10 +1205,7 @@ impl Render for CommitViewToolbar {
}),
)
.children(remote_info.map(|(provider_name, url)| {
let icon = match provider_name.as_str() {
"GitHub" => IconName::Github,
_ => IconName::Link,
};
let icon = crate::get_provider_icon(provider_name.as_str());

IconButton::new("view_on_provider", icon)
.icon_size(IconSize::Small)
Expand Down
12 changes: 12 additions & 0 deletions crates/git_ui/src/git_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ pub mod worktree_service;

pub use conflict_view::MergeConflictIndicator;

pub fn get_provider_icon(name: &str) -> IconName {
match name {
"Bitbucket" => IconName::Bitbucket,
"Codeberg" => IconName::Codeberg,
"Forgejo Self-Hosted" => IconName::Forgejo,
"GitHub" => IconName::Github,
"GitLab" => IconName::Gitlab,
"Gitea" => IconName::Gitea,
_ => IconName::Link,
}
}

pub fn init(cx: &mut App) {
editor::set_blame_renderer(blame_ui::GitBlameRenderer, cx);
commit_view::init(cx);
Expand Down
5 changes: 5 additions & 0 deletions crates/icons/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub enum IconName {
BellOff,
BellRing,
Binary,
Bitbucket,
Blocks,
Bookmark,
BoltFilled,
Expand All @@ -70,6 +71,7 @@ pub enum IconName {
Close,
CloudDownload,
Code,
Codeberg,
Command,
Control,
Copilot,
Expand Down Expand Up @@ -140,6 +142,7 @@ pub enum IconName {
Font,
FontSize,
FontWeight,
Forgejo,
ForwardArrow,
ForwardArrowUp,
GenericClose,
Expand All @@ -152,7 +155,9 @@ pub enum IconName {
GitGraph,
GitMergeConflict,
GitWorktree,
Gitea,
Github,
Gitlab,
Hash,
HistoryRerun,
Image,
Expand Down
Loading