Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on creating worktree #6277

Closed
rysavyjan opened this issue Feb 19, 2019 · 1 comment
Closed

Exception on creating worktree #6277

rysavyjan opened this issue Feb 19, 2019 · 1 comment

Comments

@rysavyjan
Copy link
Contributor

rysavyjan commented Feb 19, 2019

Current behaviour

In repository with only one branch (master) when choosing Create a new worktree command, the Checkout an existing branch combobox is empty and disabled. When I specify Create a new branch and click the Create the new worktree button, following exception is displayed:

GitUI.CommandsDialogs.WorktreeDialog.FormCreateWorktree.CreateWorktree()
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

System.NullReferenceException
Object reference not set to an instance of an object.
Void CreateWorktree() @ GitUI.CommandsDialogs.WorktreeDialog.FormCreateWorktree

Problem is my empty combobox and following code:

            var args = new GitArgumentBuilder("worktree")
            {
                "add",
                WorktreeDirectory.Quote(),
                { radioButtonCreateNewBranch.Checked, $"-b {textBoxNewBranchName.Text}", ((GitRef)comboBoxBranches.SelectedItem).Name }
            };

Screenshots

gitextproblem

Environment

  • Git Extensions 3.0.2.5232
  • Build 23b6f51
  • Git 2.20.1.windows.1
  • Microsoft Windows NT 10.0.17763.0
  • .NET Framework 4.7.3260.0
  • DPI 144dpi (150% scaling)
@gerhardol gerhardol added type: bug 🐛 up-for-grabs Easy tasks for those looking to get involved. Refer to https://up-for-grabs.net/ status: workaround available 🤓 good first issue labels Feb 19, 2019
@gerhardol
Copy link
Member

Confirmed
The workaround is of course to create the branch prior to creating the worktree

@rysavyjan
Is it possible for you to send a PR?

rysavyjan added a commit to rysavyjan/gitextensions that referenced this issue Feb 19, 2019
@gerhardol gerhardol added this to the 3.1.0 milestone Feb 19, 2019
@RussKie RussKie closed this as completed Feb 19, 2019
@RussKie RussKie removed 🤓 good first issue up-for-grabs Easy tasks for those looking to get involved. Refer to https://up-for-grabs.net/ labels Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants