Skip to content

Commit

Permalink
Disable hotkeys in scenarios where their usage was not intended (#11109)
Browse files Browse the repository at this point in the history
Fixes #11108
  • Loading branch information
IlijaQ committed Aug 1, 2023
1 parent b13b0c8 commit c940ea1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GitUI/CommandsDialogs/FormBrowse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 10 additions & 0 deletions GitUI/GitUICommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c940ea1

Please sign in to comment.