@@ -39,10 +39,9 @@ fn main() -> Result<()> {
|
||||
// This behavior follows git itself
|
||||
None => {
|
||||
let start = args.repo_url.rfind("/").unwrap() + 1;
|
||||
let end = match args.repo_url.rfind(".git")
|
||||
{
|
||||
let end = match args.repo_url.rfind(".git") {
|
||||
Some(index) => index,
|
||||
None => args.repo_url.len()
|
||||
None => args.repo_url.len(),
|
||||
};
|
||||
|
||||
args.repo_url[start..end].to_owned()
|
||||
@@ -56,7 +55,10 @@ fn main() -> Result<()> {
|
||||
println!("{}", format!("Target directory: {target_dir}").dimmed());
|
||||
}
|
||||
|
||||
println!("{}", "Setting up repository for worktree development".blue());
|
||||
println!(
|
||||
"{}",
|
||||
"Setting up repository for worktree development".blue()
|
||||
);
|
||||
|
||||
// Clone the repository as a bare clone
|
||||
Git::clone_bare_repo(&args.repo_url, &target_dir)?;
|
||||
@@ -71,6 +73,9 @@ fn main() -> Result<()> {
|
||||
Git::fetch_remotes(&target_dir)?;
|
||||
|
||||
println!("{}", "Repository setup complete.".green());
|
||||
println!("{}", format!("You can now create worktrees in '{target_dir}'.").green());
|
||||
println!(
|
||||
"{}",
|
||||
format!("You can now create worktrees in '{target_dir}'.").green()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user