diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 092768c2cd97fa82079979301704ee66c969196e..bd17788506faa62f33618d4450000af1e7b8aec9 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -4011,15 +4011,21 @@ impl GitPanel { if entry.status.is_created() { context_menu = - context_menu.action("Add to .gitignore", git::AddToGitignore.boxed_clone()); + context_menu.action("Add to .gitignore", git::AddToGitignore.boxed_clone()) } - context_menu + let mut context_menu = context_menu .separator() .action("Open Diff", Confirm.boxed_clone()) - .action("Open File", SecondaryConfirm.boxed_clone()) - .separator() - .action("File History", Box::new(git::FileHistory)) + .action("Open File", SecondaryConfirm.boxed_clone()); + + if !entry.status.is_created() { + context_menu = context_menu + .separator() + .action("File History", Box::new(git::FileHistory)); + } + + context_menu }); self.selected_entry = Some(ix); self.set_context_menu(context_menu, position, window, cx);