@@ -2,7 +2,7 @@ use crate::{bstr::BStr, revision, Id};
2
2
3
3
/// Methods for resolving revisions by spec or working with the commit graph.
4
4
impl crate :: Repository {
5
- /// Parse a revision specification and turn it into the full id to the object it describes, similar to `git rev-parse`.
5
+ /// Parse a revision specification and turn it into the object(s) it describes, similar to `git rev-parse`.
6
6
pub fn rev_parse < ' a > ( & self , spec : impl Into < & ' a BStr > ) -> Result < revision:: Spec < ' _ > , revision:: spec:: parse:: Error > {
7
7
revision:: Spec :: from_bstr (
8
8
spec,
@@ -14,15 +14,15 @@ impl crate::Repository {
14
14
)
15
15
}
16
16
17
- /// Parse a revision specification and return a Result containing the single included object
18
- /// represented by this instance, or `Err` if it is a range of any kind.
17
+ /// Parse a revision specification and return single object id as represented by this instance.
19
18
pub fn rev_parse_single < ' repo , ' a > (
20
19
& ' repo self ,
21
20
spec : impl Into < & ' a BStr > ,
22
- ) -> Result < Id < ' repo > , revision:: spec:: parse:: Error > {
21
+ ) -> Result < Id < ' repo > , revision:: spec:: parse:: single:: Error > {
22
+ let spec = spec. into ( ) ;
23
23
self . rev_parse ( spec) ?
24
24
. single ( )
25
- . ok_or ( revision:: spec:: parse:: Error :: SingleNotFound )
25
+ . ok_or ( revision:: spec:: parse:: single :: Error :: RangedRev { spec : spec . into ( ) } )
26
26
}
27
27
28
28
/// Create the baseline for a revision walk by initializing it with the `tips` to start iterating on.
0 commit comments