Skip to content

Commit

Permalink
Make FormReflog use UICommands to display FormCreateBranch to get Pos…
Browse files Browse the repository at this point in the history
…tRepositoryChanged event
  • Loading branch information
amaiorano committed Dec 7, 2018
1 parent 6bad4b1 commit aeb633d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GitUI/CommandsDialogs/FormReflog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ private void createABranchOnThisCommitToolStripMenuItem_Click(object sender, Eve
return;
}

using (var form = new FormCreateBranch(UICommands, GetShaOfRefLine()))
var form = new FormCreateBranch(UICommands, GetShaOfRefLine())
{
form.CheckoutAfterCreation = false;
form.UserAbleToChangeRevision = false;
form.CouldBeOrphan = false;
ShouldRefresh = form.ShowDialog(this) == DialogResult.OK;
}
CheckoutAfterCreation = false,
UserAbleToChangeRevision = false,
CouldBeOrphan = false
};
ShouldRefresh = UICommands.StartShowBranchDialog(ref form, this);
}

private ObjectId GetShaOfRefLine()
Expand Down
15 changes: 15 additions & 0 deletions GitUI/GitUICommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,21 @@ bool Action()
return DoActionOnRepo(owner, true, true, null, null, Action);
}

public bool StartShowBranchDialog(ref FormCreateBranch formCreateBranch, IWin32Window owner = null)
{
var form = formCreateBranch;
formCreateBranch = null;
bool Action()
{
using (form)
{
return form.ShowDialog(owner) == DialogResult.OK;
}
}

return DoActionOnRepo(owner, true, true, null, null, Action);
}

public bool StartCloneDialog(IWin32Window owner, string url = null, bool openedFromProtocolHandler = false, EventHandler<GitModuleEventArgs> gitModuleChanged = null)
{
bool Action()
Expand Down

0 comments on commit aeb633d

Please sign in to comment.