mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix: ignoring new files under folder creates invalid .gitignore entries (#663)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
243ce8b06d
commit
ffeb63613c
1 changed files with 4 additions and 2 deletions
|
@ -599,7 +599,8 @@ namespace SourceGit.ViewModels
|
|||
byParentFolder.IsVisible = !isRooted;
|
||||
byParentFolder.Click += (_, e) =>
|
||||
{
|
||||
Commands.GitIgnore.Add(_repo.FullPath, Path.GetDirectoryName(change.Path) + "/");
|
||||
var path = Path.GetDirectoryName(change.Path).Replace("\\", "/");
|
||||
Commands.GitIgnore.Add(_repo.FullPath, path + "/");
|
||||
e.Handled = true;
|
||||
};
|
||||
addToIgnore.Items.Add(byParentFolder);
|
||||
|
@ -620,7 +621,8 @@ namespace SourceGit.ViewModels
|
|||
byExtensionInSameFolder.IsVisible = !isRooted;
|
||||
byExtensionInSameFolder.Click += (_, e) =>
|
||||
{
|
||||
Commands.GitIgnore.Add(_repo.FullPath, Path.GetDirectoryName(change.Path) + "/*" + extension);
|
||||
var path = Path.GetDirectoryName(change.Path).Replace("\\", "/");
|
||||
Commands.GitIgnore.Add(_repo.FullPath, path + "/*" + extension);
|
||||
e.Handled = true;
|
||||
};
|
||||
addToIgnore.Items.Add(byExtensionInSameFolder);
|
||||
|
|
Loading…
Reference in a new issue