mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-24 03:45:00 +00:00
enhance: unified all file-path normalization - use char-replace, trim trailing slash
This commit is contained in:
parent
54c05ac35a
commit
88c38b4139
8 changed files with 15 additions and 17 deletions
|
@ -780,7 +780,7 @@ namespace SourceGit.ViewModels
|
|||
byParentFolder.IsVisible = !isRooted;
|
||||
byParentFolder.Click += (_, e) =>
|
||||
{
|
||||
var dir = Path.GetDirectoryName(change.Path)!.Replace("\\", "/");
|
||||
var dir = Path.GetDirectoryName(change.Path)!.Replace('\\', '/').TrimEnd('/');
|
||||
Commands.GitIgnore.Add(_repo.FullPath, dir + "/");
|
||||
e.Handled = true;
|
||||
};
|
||||
|
@ -802,7 +802,7 @@ namespace SourceGit.ViewModels
|
|||
byExtensionInSameFolder.IsVisible = !isRooted;
|
||||
byExtensionInSameFolder.Click += (_, e) =>
|
||||
{
|
||||
var dir = Path.GetDirectoryName(change.Path)!.Replace("\\", "/");
|
||||
var dir = Path.GetDirectoryName(change.Path)!.Replace('\\', '/').TrimEnd('/');
|
||||
Commands.GitIgnore.Add(_repo.FullPath, $"{dir}/*{extension}");
|
||||
e.Handled = true;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue