Skip to content

Commit 21fbd88

Browse files
committed
fix: remove unnecessary check / shadow repo root var
1 parent 48e0345 commit 21fbd88

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

rust/patchable/src/main.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ pub enum Error {
205205
FindImagesRepo { source: repo::Error },
206206
#[snafu(display("images repository has no work directory"))]
207207
NoImagesRepoWorkdir,
208-
#[snafu(display("images repository root at {path:?} is not a directory"))]
209-
ImagesRepoRootDirCheck { path: PathBuf },
210208

211209
#[snafu(display("failed to fetch patch series' base commit"))]
212210
FetchBaseCommit { source: repo::Error },
@@ -269,19 +267,14 @@ fn main() -> Result<()> {
269267
.context(ConfigureGitLoggingSnafu)?;
270268

271269
let opts = <Opts as clap::Parser>::parse();
272-
let images_repo_root_pathbuf = match opts.images_repo_root {
273-
Some(path) => {
274-
if !path.is_dir() {
275-
return ImagesRepoRootDirCheckSnafu { path }.fail();
276-
}
277-
path
278-
}
270+
let images_repo_root = match opts.images_repo_root {
271+
Some(path) => path,
279272
None => {
280273
let images_repo = repo::discover_images_repo(".").context(FindImagesRepoSnafu)?;
281274
images_repo.workdir().context(NoImagesRepoWorkdirSnafu)?.to_owned()
282275
}
283276
};
284-
let images_repo_root = images_repo_root_pathbuf.as_path();
277+
let images_repo_root = images_repo_root.as_path();
285278
match opts.cmd {
286279
Cmd::Checkout { pv, base_only } => {
287280
let ctx = ProductVersionContext {

0 commit comments

Comments
 (0)