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
/// 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,13 +21,11 @@ mod error {
19
21
20
22
pubuse error::Error;
21
23
22
-
usecrate::head::Kind;
23
-
24
24
///
25
-
pubmodto_commit{
25
+
pubmodinto_id{
26
26
usecrate::object;
27
27
28
-
/// The error returned by [`Head::peel_to_commit_in_place()`][super::Head::peel_to_commit_in_place()].
28
+
/// The error returned by [`Head::into_peeled_id()`](super::Head::into_peeled_id()).
29
29
#[derive(Debug, thiserror::Error)]
30
30
#[allow(missing_docs)]
31
31
pubenumError{
@@ -38,86 +38,122 @@ pub mod to_commit {
38
38
}
39
39
}
40
40
41
+
///
42
+
pubmod to_commit {
43
+
usecrate::object;
44
+
45
+
/// The error returned by [`Head::peel_to_commit_in_place()`](super::Head::peel_to_commit_in_place()).
46
+
#[derive(Debug, thiserror::Error)]
47
+
#[allow(missing_docs)]
48
+
pubenumError{
49
+
#[error(transparent)]
50
+
PeelToObject(#[from]super::to_object::Error),
51
+
#[error(transparent)]
52
+
ObjectKind(#[from] object::try_into::Error),
53
+
}
54
+
}
55
+
56
+
///
57
+
pubmod to_object {
58
+
/// The error returned by [`Head::peel_to_object_in_place()`](super::Head::peel_to_object_in_place()).
59
+
#[derive(Debug, thiserror::Error)]
60
+
#[allow(missing_docs)]
61
+
pubenumError{
62
+
#[error(transparent)]
63
+
Peel(#[from]super::Error),
64
+
#[error("Branch '{name}' does not have any commits")]
65
+
Unborn{name: gix_ref::FullName},
66
+
}
67
+
}
68
+
41
69
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)
70
+
/// Peel this instance and consume it to make obtaining its final target id possible, while returning an error on unborn heads.
71
+
///
72
+
/// The final target is obtained by following symbolic references and peeling tags to their final destination, which
0 commit comments