diff --git a/GitUI/CommandsDialogs/FormBrowse.cs b/GitUI/CommandsDialogs/FormBrowse.cs index 0f8969d8bf7..57f2ab662d7 100644 --- a/GitUI/CommandsDialogs/FormBrowse.cs +++ b/GitUI/CommandsDialogs/FormBrowse.cs @@ -1525,7 +1525,7 @@ private void RebaseToolStripMenuItemClick(object sender, EventArgs e) { var revisions = RevisionGrid.GetSelectedRevisions(); - if (revisions.Count == 0) + if (revisions.Count == 0 || revisions[0].IsArtificial) { return; } diff --git a/GitUI/GitUICommands.cs b/GitUI/GitUICommands.cs index 1d0eaa1157a..09bc6b2da32 100644 --- a/GitUI/GitUICommands.cs +++ b/GitUI/GitUICommands.cs @@ -440,6 +440,11 @@ public bool StartCreateBranchDialog(IWin32Window? owner, string? branch) public bool StartCreateBranchDialog(IWin32Window? owner = null, ObjectId? objectId = null, string? newBranchNamePrefix = null) { + if (Module.IsBareRepository() || objectId?.IsArtificial is true) + { + return false; + } + bool Action() { using FormCreateBranch form = new(this, objectId, newBranchNamePrefix); @@ -853,6 +858,11 @@ bool Action() public bool StartCreateTagDialog(IWin32Window? owner = null, GitRevision? revision = null) { + if (revision?.IsArtificial is true) + { + return false; + } + bool Action() { using FormCreateTag form = new(this, revision?.ObjectId);