Skip to content

Commit

Permalink
Dont confirm switch worktree option (gitextensions#6864)
Browse files Browse the repository at this point in the history
  • Loading branch information
KarstenRa committed Oct 2, 2019
1 parent 429a4f0 commit 497448b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
6 changes: 6 additions & 0 deletions GitCommands/Settings/AppSettings.cs
Expand Up @@ -884,6 +884,12 @@ public static bool DontConfirmFetchAndPruneAll
set => SetBool("DontConfirmFetchAndPruneAll", value);
}

public static bool DontConfirmSwitchWorktree
{
get => GetBool("DontConfirmSwitchWorktree", false);
set => SetBool("DontConfirmSwitchWorktree", value);
}

public static bool IncludeUntrackedFilesInAutoStash
{
get => GetBool("includeUntrackedFilesInAutoStash", false);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -28,6 +28,7 @@ protected override void SettingsToPage()
chkRebaseOnTopOfSelectedCommit.Checked = AppSettings.DontConfirmRebase;
chkUndoLastCommitConfirmation.Checked = AppSettings.DontConfirmUndoLastCommit;
chkFetchAndPruneAllConfirmation.Checked = AppSettings.DontConfirmFetchAndPruneAll;
chkSwitchWorktree.Checked = AppSettings.DontConfirmSwitchWorktree;
}

protected override void PageToSettings()
Expand All @@ -46,6 +47,7 @@ protected override void PageToSettings()
AppSettings.DontConfirmRebase = chkRebaseOnTopOfSelectedCommit.Checked;
AppSettings.DontConfirmUndoLastCommit = chkUndoLastCommitConfirmation.Checked;
AppSettings.DontConfirmFetchAndPruneAll = chkFetchAndPruneAllConfirmation.Checked;
AppSettings.DontConfirmSwitchWorktree = chkSwitchWorktree.Checked;
}

public static SettingsPageReference GetPageReference()
Expand Down
4 changes: 2 additions & 2 deletions GitUI/CommandsDialogs/WorktreeDialog/FormManageWorktree.cs
Expand Up @@ -207,8 +207,8 @@ private void Worktrees_CellClick(object sender, DataGridViewCellEventArgs e)

if (e.ColumnIndex == 5)
{
if (MessageBox.Show(this, "Are you sure you want to switch to this worktree?", "Open a worktree",
MessageBoxButtons.YesNo) == DialogResult.Yes)
if (AppSettings.DontConfirmSwitchWorktree || MessageBox.Show(this,
"Are you sure you want to switch to this worktree?", "Open a worktree", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (Directory.Exists(workTree.Path))
{
Expand Down

0 comments on commit 497448b

Please sign in to comment.