Unified · Split
| @@ -12,9 +12,10 @@ pub(crate) mod extension; · 11 unmodified lines | |||
| 12 | pub mod entry; | 12 | pub mod entry; |
| 13 | 13 | ||
| 14 | mod access { | 14 | mod access { |
| 15 | use crate::{Entry, State, Version}; | ||
| 16 | use bstr::{BStr, ByteSlice}; | 15 | use bstr::{BStr, ByteSlice}; |
| 17 | 16 | ||
| 17 | use crate::{Entry, State, Version}; | ||
| 18 | |||
| 18 | impl State { | 19 | impl State { |
| 19 | pub fn version(&self) -> Version { | 20 | pub fn version(&self) -> Version { |
| 20 | self.version | 21 | self.version |
| @@ -64,14 +64,18 @@ pub mod index { · 63 unmodified lines | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | pub(crate) mod entry { | 66 | pub(crate) mod entry { |
| 67 | use crate::index; | 67 | use std::{ |
| 68 | convert::TryInto, | ||
| 69 | fs::{create_dir_all, OpenOptions}, | ||
| 70 | io::Write, | ||
| 71 | time::Duration, | ||
| 72 | }; | ||
| 73 | |||
| 68 | use git_hash::oid; | 74 | use git_hash::oid; |
| 69 | use git_index::Entry; | 75 | use git_index::Entry; |
| 70 | use git_object::bstr::{BStr, ByteSlice}; | 76 | use git_object::bstr::{BStr, ByteSlice}; |
| 71 | use std::convert::TryInto; | 77 | |
| 72 | use std::fs::{create_dir_all, OpenOptions}; | 78 | use crate::index; |
| 73 | use std::io::Write; | ||
| 74 | use std::time::Duration; | ||
| 75 | 79 | ||
| 76 | pub fn checkout<Find>( | 80 | pub fn checkout<Find>( |
| 77 | entry: &mut Entry, | 81 | entry: &mut Entry, |
| @@ -1,11 +1,12 @@ | |||
| 1 | use crate::{dir_structure, fixture_path}; | 1 | use std::fs; |
| 2 | #[cfg(unix)] | ||
| 3 | use std::os::unix::prelude::MetadataExt; | ||
| 4 | |||
| 2 | use git_object::bstr::ByteSlice; | 5 | use git_object::bstr::ByteSlice; |
| 3 | use git_odb::FindExt; | 6 | use git_odb::FindExt; |
| 4 | use git_worktree::index; | 7 | use git_worktree::index; |
| 5 | use std::fs; | ||
| 6 | 8 | ||
| 7 | #[cfg(unix)] | 9 | use crate::{dir_structure, fixture_path}; |
| 8 | use std::os::unix::prelude::MetadataExt; | ||
| 9 | 10 | ||
| 10 | #[test] | 11 | #[test] |
| 11 | fn test_copy_index() -> crate::Result<()> { | 12 | fn test_copy_index() -> crate::Result<()> { |
| @@ -1,4 +1,5 @@ | |||
| 1 | use std::path::{Path, PathBuf}; | 1 | use std::path::{Path, PathBuf}; |
| 2 | |||
| 2 | use walkdir::WalkDir; | 3 | use walkdir::WalkDir; |
| 3 | 4 | ||
| 4 | mod copy_index; | 5 | mod copy_index; |