mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -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.IsVisible = !isRooted;
|
||||||
byParentFolder.Click += (_, e) =>
|
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;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
addToIgnore.Items.Add(byParentFolder);
|
addToIgnore.Items.Add(byParentFolder);
|
||||||
|
@ -620,7 +621,8 @@ namespace SourceGit.ViewModels
|
||||||
byExtensionInSameFolder.IsVisible = !isRooted;
|
byExtensionInSameFolder.IsVisible = !isRooted;
|
||||||
byExtensionInSameFolder.Click += (_, e) =>
|
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;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
addToIgnore.Items.Add(byExtensionInSameFolder);
|
addToIgnore.Items.Add(byExtensionInSameFolder);
|
||||||
|
|
Loading…
Reference in a new issue