@@ -15,19 +15,19 @@ mod test;
1515
1616mod inner;
1717
18- use super :: { error:: git:: Error , Content , PublishOutcome , Record } ;
19- use crate :: {
20- core:: AtomPaths ,
21- store:: { git:: Root , NormalizeStorePath } ,
22- Atom , AtomId ,
23- } ;
24-
25- use gix:: Commit ;
26- use gix:: { ObjectId , Repository , Tree } ;
2718use std:: cell:: RefCell ;
2819use std:: path:: { Path , PathBuf } ;
20+
21+ use gix:: { Commit , ObjectId , Repository , Tree } ;
2922use tokio:: task:: JoinSet ;
3023
24+ use super :: error:: git:: Error ;
25+ use super :: { Content , PublishOutcome , Record } ;
26+ use crate :: core:: AtomPaths ;
27+ use crate :: store:: NormalizeStorePath ;
28+ use crate :: store:: git:: Root ;
29+ use crate :: { Atom , AtomId } ;
30+
3131type GitAtomId = AtomId < Root > ;
3232/// The Outcome of an Atom publish attempt to a Git store.
3333pub type GitOutcome = PublishOutcome < Root > ;
@@ -198,7 +198,7 @@ impl<'a> StateValidator<Root> for GitPublisher<'a> {
198198 return Err ( Error :: Duplicates ) ;
199199 }
200200 atoms. insert ( atom. id , path) ;
201- }
201+ } ,
202202 Err ( e) => e. warn ( ) ,
203203 }
204204 }
@@ -228,31 +228,36 @@ impl GitContent {
228228 pub fn spec ( & self ) -> & gix:: refs:: Reference {
229229 & self . spec
230230 }
231+
231232 /// Return a reference to the Atom src Git ref.
232233 #[ must_use]
233234 pub fn origin ( & self ) -> & gix:: refs:: Reference {
234235 & self . origin
235236 }
237+
236238 /// Return a reference to the Atom content ref.
237239 #[ must_use]
238240 pub fn content ( & self ) -> & gix:: refs:: Reference {
239241 & self . content
240242 }
243+
241244 /// Return a reference to the path to the Atom.
242245 #[ must_use]
243246 pub fn path ( & self ) -> & PathBuf {
244247 & self . path
245248 }
249+
246250 /// Return a reference to the atom ref prefix.
247251 #[ must_use]
248252 pub fn ref_prefix ( & self ) -> & String {
249253 & self . ref_prefix
250254 }
251255}
252256
257+ use std:: collections:: HashMap ;
258+
253259use super :: Publish ;
254260use crate :: id:: Id ;
255- use std:: collections:: HashMap ;
256261
257262impl < ' a > super :: private:: Sealed for GitContext < ' a > { }
258263
@@ -261,12 +266,15 @@ impl<'a> Publish<Root> for GitContext<'a> {
261266
262267 /// Publishes atoms.
263268 ///
264- /// This function processes a collection of paths, each representing an atom to be published. The publishing
265- /// process includes path normalization, existence checks, and actual publishing attempts.
269+ /// This function processes a collection of paths, each representing an atom to be published.
270+ /// The publishing process includes path normalization, existence checks, and actual
271+ /// publishing attempts.
266272 ///
267273 /// # Path Normalization
268- /// - First attempts to interpret each path as relative to the caller's current location inside the repository.
269- /// - If normalization fails (e.g., in a bare repository), falls back to treating the path as already relative to the repo root.
274+ /// - First attempts to interpret each path as relative to the caller's current location inside
275+ /// the repository.
276+ /// - If normalization fails (e.g., in a bare repository), falls back to treating the path as
277+ /// already relative to the repo root.
270278 /// - The normalized path is used to search the Git history, not the file system.
271279 ///
272280 /// # Publishing Process
@@ -285,8 +293,8 @@ impl<'a> Publish<Root> for GitContext<'a> {
285293 ///
286294 /// # Return Value
287295 /// Returns a vector of results types (`Vec<Result<PublishOutcome<T>, Self::Error>>`), where the
288- /// outter result represents whether an atom has failed, and the inner result determines whether an
289- /// atom was safely skipped, e.g. because it already exists..
296+ /// outter result represents whether an atom has failed, and the inner result determines whether
297+ /// an atom was safely skipped, e.g. because it already exists..
290298 fn publish < C > ( & self , paths : C ) -> Vec < GitResult < GitOutcome > >
291299 where
292300 C : IntoIterator < Item = PathBuf > ,
@@ -306,8 +314,7 @@ impl<'a> Publish<Root> for GitContext<'a> {
306314 }
307315
308316 fn publish_atom < P : AsRef < Path > > ( & self , path : P ) -> GitResult < GitOutcome > {
309- use Err as Skipped ;
310- use Ok as Published ;
317+ use { Err as Skipped , Ok as Published } ;
311318
312319 let atom = AtomContext :: set ( path. as_ref ( ) , self ) ?;
313320
@@ -385,13 +392,13 @@ impl<'a> GitContext<'a> {
385392 if !output. is_empty ( ) {
386393 tracing:: info!( output = %String :: from_utf8_lossy( & output) ) ;
387394 }
388- }
395+ } ,
389396 Ok ( Err ( e) ) => {
390397 errors. push ( e) ;
391- }
398+ } ,
392399 Err ( e) => {
393400 errors. push ( Error :: JoinFailed ( e) ) ;
394- }
401+ } ,
395402 }
396403 }
397404 }
0 commit comments