mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
fix<Repository>: fix filter not work when there's no files under .git/refs/xxx/
This commit is contained in:
parent
38810c440e
commit
4d7b16dc75
1 changed files with 3 additions and 1 deletions
|
@ -100,10 +100,12 @@ namespace SourceGit.Models {
|
|||
// 未填写参数就检测,去掉无效的过滤
|
||||
if (Filters.Count > 0) {
|
||||
var invalidFilters = new List<string>();
|
||||
var branches = new Commands.Branches(Path).Result();
|
||||
var tags = new Commands.Tags(Path).Result();
|
||||
|
||||
foreach (var filter in Filters) {
|
||||
if (filter.StartsWith("refs/")) {
|
||||
if (!ExistsInGitDir(filter)) invalidFilters.Add(filter);
|
||||
if (branches.FindIndex(b => b.FullName == filter) < 0) invalidFilters.Add(filter);
|
||||
} else {
|
||||
if (tags.FindIndex(t => t.Name == filter) < 0) invalidFilters.Add(filter);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue