Skip to content

Commit

Permalink
Add menu command to exclude a specific file locally
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Jul 14, 2016
1 parent 35ca60f commit c33ae79
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions GitUI/CommandsDialogs/FormCommit.Designer.cs

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

12 changes: 11 additions & 1 deletion GitUI/CommandsDialogs/FormCommit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1718,13 +1718,23 @@ private void generateListOfChangesInSubmodulesChangesToolStripMenuItem_Click(obj
}

private void AddFileTogitignoreToolStripMenuItemClick(object sender, EventArgs e)
{
HandleExcludeFileClick(false);
}

private void AddFileToGitInfoExcludeToolStripMenuItemClick(object sender, EventArgs e)
{
HandleExcludeFileClick(true);
}

private void HandleExcludeFileClick(bool localExclude)
{
if (!Unstaged.SelectedItems.Any())
return;

SelectedDiff.Clear();
var fileNames = Unstaged.SelectedItems.Select(item => item.Name).ToArray();
if (UICommands.StartAddToGitIgnoreDialog(this, false, fileNames))
if (UICommands.StartAddToGitIgnoreDialog(this, localExclude, fileNames))
Initialize();
}

Expand Down

0 comments on commit c33ae79

Please sign in to comment.