(repo_root: &Path)
| 69 | |
| 70 | let mut result = RepoBootstrapResult::default(); |
| 71 | |
| 72 | if !is_git_repository(repo_root, git_config_args)? { |
| 73 | let git_dir = repo_root.join(".git"); |
| 74 | if git_dir.is_dir() { |
| 75 | result.removed_stale_git_locks = init_blockers::remove_stale_locks(&git_dir)?; |
| 76 | result.backed_up_git_config = init_blockers::back_up_unreadable_config(repo_root)?; |
| 77 | } |
| 78 | initialize_repo(repo_root, git_config_args)?; |
| 79 | result.initialized_repo = true; |
| 80 | } |
| 81 | |
| 82 | if !has_head_commit(repo_root, git_config_args) { |
| 83 | create_bootstrap_commit(&WorktreeGit::discovered(repo_root), git_config_args)?; |
| 84 | result.created_initial_commit = true; |
| 85 | } |
| 86 | |
| 87 | Ok(result) |
| 88 | } |
| 89 | |
| 90 | fn configured_args<'a>(git_config_args: &[&'a str], args: &[&'a str]) -> Vec<&'a str> { |
| 91 | git_config_args.iter().chain(args.iter()).copied().collect() |
| 92 | } |
no test coverage detected