File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ public void QueryingTheCommitHistoryWithUnknownShaOrInvalidEntryPointThrows()
98
98
{
99
99
Assert . Throws < LibGit2SharpException > ( ( ) => repo . Commits . QueryBy ( new Filter { Since = Constants . UnknownSha } ) . Count ( ) ) ;
100
100
Assert . Throws < LibGit2SharpException > ( ( ) => repo . Commits . QueryBy ( new Filter { Since = "refs/heads/deadbeef" } ) . Count ( ) ) ;
101
+ Assert . Throws < ArgumentNullException > ( ( ) => repo . Commits . QueryBy ( new Filter { Since = null } ) . Count ( ) ) ;
101
102
}
102
103
}
103
104
@@ -119,6 +120,8 @@ public void QueryingTheCommitHistoryWithBadParamsThrows()
119
120
{
120
121
using ( var repo = new Repository ( BareTestRepoPath ) )
121
122
{
123
+ Assert . Throws < ArgumentException > ( ( ) => repo . Commits . QueryBy ( new Filter { Since = string . Empty } ) ) ;
124
+ Assert . Throws < ArgumentNullException > ( ( ) => repo . Commits . QueryBy ( new Filter { Since = null } ) ) ;
122
125
Assert . Throws < ArgumentNullException > ( ( ) => repo . Commits . QueryBy ( null ) ) ;
123
126
}
124
127
}
Original file line number Diff line number Diff line change @@ -87,6 +87,12 @@ public virtual ICommitLog QueryBy(Filter filter)
87
87
{
88
88
Ensure . ArgumentNotNull ( filter , "filter" ) ;
89
89
90
+ if ( string . IsNullOrEmpty ( filter . SinceGlob ) )
91
+ {
92
+ Ensure . ArgumentNotNull ( filter . Since , "filter.Since" ) ;
93
+ Ensure . ArgumentNotNullOrEmptyString ( filter . Since . ToString ( ) , "filter.Since" ) ;
94
+ }
95
+
90
96
return new CommitLog ( repo , filter ) ;
91
97
}
92
98
You can’t perform that action at this time.
0 commit comments