File tree Expand file tree Collapse file tree 3 files changed +3
-9
lines changed
git-repository/tests/reference
gitoxide-core/src/repository Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ mod find {
70
70
fn set_target_id ( ) {
71
71
let ( repo, _tmp) = repo_rw ( "make_basic_repo.sh" ) . unwrap ( ) ;
72
72
let mut head_ref = repo. head_ref ( ) . unwrap ( ) . expect ( "present" ) ;
73
- let target_id = repo. rev_parse ( ":/c1" ) . unwrap ( ) . single ( ) . unwrap ( ) ;
73
+ let target_id = repo. rev_parse_single ( ":/c1" ) . unwrap ( ) ;
74
74
let prev_id = head_ref. id ( ) ;
75
75
assert_ne ! ( prev_id, target_id, "we don't point to the target id yet" ) ;
76
76
head_ref. set_target_id ( target_id, "reflog message" ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -18,12 +18,7 @@ pub fn describe(
18
18
) -> Result < ( ) > {
19
19
repo. object_cache_size_if_unset ( 4 * 1024 * 1024 ) ;
20
20
let commit = match rev_spec {
21
- Some ( spec) => repo
22
- . rev_parse ( spec) ?
23
- . single ( )
24
- . context ( "Need single revision revspec" ) ?
25
- . object ( ) ?
26
- . try_into_commit ( ) ?,
21
+ Some ( spec) => repo. rev_parse_single ( spec) ?. object ( ) ?. try_into_commit ( ) ?,
27
22
None => repo. head_commit ( ) ?,
28
23
} ;
29
24
use git:: commit:: describe:: SelectRef :: * ;
Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ pub fn list(
18
18
19
19
let spec = git:: path:: os_str_into_bstr ( & spec) ?;
20
20
let id = repo
21
- . rev_parse ( spec) ?
22
- . single ( )
21
+ . rev_parse_single ( spec)
23
22
. context ( "Only single revisions are currently supported" ) ?;
24
23
let commit_id = id
25
24
. object ( ) ?
You can’t perform that action at this time.
0 commit comments