File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,19 @@ pub mod parse {
51
51
52
52
pub ( crate ) mod function {
53
53
use crate :: spec:: parse:: { Delegate , Error } ;
54
- use bstr:: BStr ;
54
+ use bstr:: { BStr , ByteSlice } ;
55
+
56
+ fn next ( i : & BStr ) -> ( u8 , & BStr ) {
57
+ let b = i[ 0 ] ;
58
+ ( b, i[ 1 ..] . as_bstr ( ) ) . into ( )
59
+ }
60
+
61
+ pub fn parse ( mut input : & BStr , delegate : & mut impl Delegate ) -> Result < ( ) , Error > {
62
+ if let Some ( b'^' ) = input. get ( 0 ) {
63
+ input = next ( input) . 1 ;
64
+ delegate. kind ( crate :: spec:: Kind :: Range ) ;
65
+ }
55
66
56
- pub fn parse ( input : & BStr , delegate : & mut impl Delegate ) -> Result < ( ) , Error > {
57
67
if input == "@" || input == "HEAD" {
58
68
return delegate. resolve_ref ( "HEAD" . into ( ) ) . ok_or ( Error :: Delegate ) ;
59
69
}
Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ mod parse {
65
65
}
66
66
67
67
#[ test]
68
- #[ ignore]
69
68
fn leading_caret_is_range_kind ( ) {
70
69
let rec = parse ( "^HEAD" ) ;
71
70
assert_eq ! ( rec. kind. unwrap( ) , spec:: Kind :: Range ) ;
You can’t perform that action at this time.
0 commit comments