File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ pub fn optimize_patterns(entries: &Vec<GlobEntry>) -> Vec<GlobEntry> {
97
97
// 1. All base paths in the pattern_map, that start with the current base path, can be removed.
98
98
// 2. All patterns that are not `**/*` can be removed from the current base path.
99
99
100
- pattern_map
100
+ let mut glob_entries = pattern_map
101
101
. into_iter ( )
102
102
. map ( |( base, patterns) | {
103
103
let size = patterns. len ( ) ;
@@ -116,7 +116,12 @@ pub fn optimize_patterns(entries: &Vec<GlobEntry>) -> Vec<GlobEntry> {
116
116
} ,
117
117
}
118
118
} )
119
- . collect :: < Vec < GlobEntry > > ( )
119
+ . collect :: < Vec < GlobEntry > > ( ) ;
120
+
121
+ // Sort the entries by base path to ensure we have stable results.
122
+ glob_entries. sort_by ( |a, z| a. base . cmp ( & z. base ) ) ;
123
+
124
+ glob_entries
120
125
}
121
126
122
127
// Split a glob pattern into a `static` and `dynamic` part.
You can’t perform that action at this time.
0 commit comments