File tree Expand file tree Collapse file tree 5 files changed +121
-65
lines changed Expand file tree Collapse file tree 5 files changed +121
-65
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ import type { GitRevisionReference } from './models/reference';
66import type { GitUser } from './models/user' ;
77import { isSha , shortenRevision } from './utils/revision.utils' ;
88
9+ export interface GitCommitSearchContext {
10+ readonly query : SearchQuery ;
11+ readonly queryFilters : SearchQueryFilters ;
12+ readonly matchedFiles : ReadonlyArray < Readonly < { readonly path : string } > > ;
13+ }
14+
915export interface GitGraphSearchResultData {
1016 readonly date : number ;
1117 readonly i : number ;
Original file line number Diff line number Diff line change 1+ import type { GitCommitSearchContext } from '../search' ;
2+
3+ export function areSearchContextsEqual (
4+ a : GitCommitSearchContext | undefined ,
5+ b : GitCommitSearchContext | undefined ,
6+ deep : boolean ,
7+ ) : boolean {
8+ if ( a === b ) return true ;
9+ if ( a == null || b == null ) return false ;
10+
11+ return (
12+ a . query === b . query &&
13+ ( ! deep ||
14+ ( a . queryFilters . files === b . queryFilters . files &&
15+ a . queryFilters . refs === b . queryFilters . refs &&
16+ a . queryFilters . type === b . queryFilters . type &&
17+ a . matchedFiles . length === b . matchedFiles . length &&
18+ a . matchedFiles . every ( ( f , i ) => f . path === b . matchedFiles [ i ] . path ) ) )
19+ ) ;
20+ }
You can’t perform that action at this time.
0 commit comments