コード例 #1
0
        private void CreateWorktree()
        {
            // https://git-scm.com/docs/git-worktree

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

            UICommands.StartGitCommandProcessDialog(this, args);
            DialogResult = DialogResult.OK;
        }
コード例 #2
0
        private void CreateWorktree()
        {
            // https://git-scm.com/docs/git-worktree
            var arguments = "worktree add \"" + WorktreeDirectory + "\"";

            if (radioButtonCreateNewBranch.Checked)
            {
                arguments += " -b " + textBoxNewBranchName.Text;
            }
            else
            {
                arguments += " " + ((GitRef)comboBoxBranches.SelectedItem).Name;
            }

            UICommands.StartGitCommandProcessDialog(arguments);
            DialogResult = DialogResult.OK;
        }