@@ -10,7 +10,7 @@ use std::{
10
10
use gix_odb:: FindExt ;
11
11
pub use gix_submodule:: * ;
12
12
13
- use crate :: { bstr:: BStr , ext :: ObjectIdExt , repository:: IndexPersistedOrInMemory , Id , Repository , Submodule } ;
13
+ use crate :: { bstr:: BStr , repository:: IndexPersistedOrInMemory , Repository , Submodule } ;
14
14
15
15
pub ( crate ) type ModulesFileStorage = gix_features:: threading:: OwnShared < gix_fs:: SharedFileSnapshotMut < File > > ;
16
16
/// A lazily loaded and auto-updated worktree index.
@@ -164,29 +164,25 @@ impl<'repo> Submodule<'repo> {
164
164
/// If `None`, but `Some()` when calling [`Self::head_id()`], then the submodule was just deleted but the change
165
165
/// wasn't yet committed.
166
166
/// If `Some()`, but `None` when calling [`Self::head_id()`], then the submodule was just added without having committed the change.
167
- pub fn index_id ( & self ) -> Result < Option < Id < ' repo > > , index_id:: Error > {
167
+ pub fn index_id ( & self ) -> Result < Option < gix_hash :: ObjectId > , index_id:: Error > {
168
168
let path = self . path ( ) ?;
169
- Ok ( self
170
- . state
171
- . index ( ) ?
172
- . entry_by_path ( & path)
173
- . map ( |entry| entry. id . attach ( self . state . repo ) ) )
169
+ Ok ( self . state . index ( ) ?. entry_by_path ( & path) . map ( |entry| entry. id ) )
174
170
}
175
171
176
172
/// Return the object id of the submodule as stored in `HEAD^{tree}` of the superproject, or `None` if it wasn't yet committed.
177
173
///
178
174
/// If `Some()`, but `None` when calling [`Self::index_id()`], then the submodule was just deleted but the change
179
175
/// wasn't yet committed.
180
176
/// If `None`, but `Some()` when calling [`Self::index_id()`], then the submodule was just added without having committed the change.
181
- pub fn head_id ( & self ) -> Result < Option < Id < ' repo > > , head_id:: Error > {
177
+ pub fn head_id ( & self ) -> Result < Option < gix_hash :: ObjectId > , head_id:: Error > {
182
178
let path = self . path ( ) ?;
183
179
Ok ( self
184
180
. state
185
181
. repo
186
182
. head_commit ( ) ?
187
183
. tree ( ) ?
188
184
. peel_to_entry_by_path ( gix_path:: from_bstr ( path. as_ref ( ) ) ) ?
189
- . map ( |entry| entry. id ( ) ) )
185
+ . map ( |entry| entry. inner . oid ) )
190
186
}
191
187
192
188
/// Return the path at which the repository of the submodule should be located.
0 commit comments