You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously it was partially untested and it was hard to obtain an object of choice.
Further breaking changes:
* rename `Head::peeled()` to `into_peeled_id()`
* rename `Head::into_fully_peeled_id()` to `try_peel_into_id()`
* rename `Head::peel_to_id_in_place()` to `Head::try_peel_to_id_in_place()`
/// The error returned by [`Head::peel_to_id_in_place()`][super::Head::peel_to_id_in_place()] and [`Head::into_fully_peeled_id()`][super::Head::into_fully_peeled_id()].
10
+
/// The error returned by [`Head::peel_to_id_in_place()`](super::Head::try_peel_to_id_in_place())
11
+
/// and [`Head::into_fully_peeled_id()`](super::Head::try_into_peeled_id()).
10
12
#[derive(Debug, thiserror::Error)]
11
13
#[allow(missing_docs)]
12
14
pubenumError{
@@ -19,7 +21,22 @@ mod error {
19
21
20
22
pubuse error::Error;
21
23
22
-
usecrate::head::Kind;
24
+
///
25
+
pubmod into_id {
26
+
usecrate::object;
27
+
28
+
/// The error returned by [`Head::into_peeled_id()`](super::Head::into_peeled_id()).
29
+
#[derive(Debug, thiserror::Error)]
30
+
#[allow(missing_docs)]
31
+
pubenumError{
32
+
#[error(transparent)]
33
+
Peel(#[from]super::Error),
34
+
#[error("Branch '{name}' does not have any commits")]
35
+
Unborn{name: gix_ref::FullName},
36
+
#[error(transparent)]
37
+
ObjectKind(#[from] object::try_into::Error),
38
+
}
39
+
}
23
40
24
41
///
25
42
pubmod to_commit {
@@ -39,85 +56,79 @@ pub mod to_commit {
39
56
}
40
57
41
58
impl<'repo>Head<'repo>{
42
-
// TODO: tests
43
-
/// Peel this instance to make obtaining its final target id possible, while returning an error on unborn heads.
44
-
pubfnpeeled(mutself) -> Result<Self,Error>{
45
-
self.peel_to_id_in_place().transpose()?;
46
-
Ok(self)
59
+
/// Peel this instance and consume to make obtaining its final target id possible, while returning an error on unborn heads.
60
+
///
61
+
/// The final target is obtained by following symbolic references and peeling tags to their final destination, which
0 commit comments