History

fix release build

Sebastian Thiel committed 4 years ago

Commit f7c19201 parent eb525f71 file · +11 −2Browse files

Unified · Split

git-worktree/src/fs/cache.rs+11−2
@@ -163,7 +163,16 @@ impl Cache { · 162 unmodified lines
163163 test_mkdir_calls,
164164 unlink_on_collision,
165165 attribute_globals: _,
166− } => create_leading_directory(components, stack, mode, test_mkdir_calls, *unlink_on_collision)?,
166+ } => {
167+ #[cfg(debug_assertions)]
168+ {
169+ create_leading_directory(components, stack, mode, test_mkdir_calls, *unlink_on_collision)?
170+ }
171+ #[cfg(not(debug_assertions))]
172+ {
173+ create_leading_directory(components, stack, mode, *unlink_on_collision)?
174+ }
175+ }
167176 State::ProvideAttributesAndIgnore { .. } => todo!(),
168177 State::ProvideIgnore { .. } => todo!(),
169178 }
@@ -179,7 +188,7 @@ fn create_leading_directory( · 9 unmodified lines
179188 components: &mut std::iter::Peekable<std::path::Components<'_>>,
180189 stack: &Stack,
181190 mode: git_index::entry::Mode,
182− mkdir_calls: &mut usize,
191+ #[cfg(debug_assertions)] mkdir_calls: &mut usize,
183192 unlink_on_collision: bool,
184193 ) -> std::io::Result<()> {
185194 let target_is_dir = mode == git_index::entry::Mode::COMMIT || mode == git_index::entry::Mode::DIR;