We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e06a008 + 1a68fd5 commit 592b461Copy full SHA for 592b461
crates/but/src/status/mod.rs
@@ -39,7 +39,15 @@ pub(crate) fn worktree(
39
show_files: bool,
40
verbose: bool,
41
) -> anyhow::Result<()> {
42
- let project = Project::find_by_path(repo_path).expect("Failed to create project from path");
+ let project = match Project::find_by_path(repo_path) {
43
+ Ok(p) => Ok(p),
44
+ Err(_e) => {
45
+ crate::init::repo(repo_path, json, false)?;
46
+ Project::find_by_path(repo_path)
47
+ }
48
+ }?;
49
+
50
+ // let project = Project::find_by_path(repo_path).expect("Failed to create project from path");
51
let ctx = &mut CommandContext::open(&project, AppSettings::load_from_default_path_creating()?)?;
52
but_rules::process_rules(ctx).ok(); // TODO: this is doing double work (dependencies can be reused)
53
0 commit comments