@@ -51,11 +51,17 @@ fn update_remote(branch: &str, create_upstream: bool) -> Result<()> {
|
||||
|
||||
if !has_remote {
|
||||
// Create remote branch
|
||||
println!("{}", format!("Branch '{branch}' does not exist on remote. Creating.").dimmed());
|
||||
println!(
|
||||
"{}",
|
||||
format!("Branch '{branch}' does not exist on remote. Creating.").dimmed()
|
||||
);
|
||||
Git::set_upstream_branch(branch)?;
|
||||
// Git::create_remote_branch(branch)?;
|
||||
} else {
|
||||
println!("{}", format!("Branch '{branch}' exists. Setting upstream.").dimmed());
|
||||
println!(
|
||||
"{}",
|
||||
format!("Branch '{branch}' exists. Setting upstream.").dimmed()
|
||||
);
|
||||
Git::set_upstream_branch(branch)?;
|
||||
}
|
||||
|
||||
@@ -73,11 +79,16 @@ fn main() -> Result<()> {
|
||||
if args.verbose {
|
||||
println!("{}", "Verbose mode enabled".dimmed());
|
||||
println!("{}", format!("Base branch: {}", args.base).dimmed());
|
||||
println!("{}", format!("Create upstream: {}", args.no_create_upstream).dimmed());
|
||||
println!(
|
||||
"{}",
|
||||
format!("Create upstream: {}", args.no_create_upstream).dimmed()
|
||||
);
|
||||
}
|
||||
|
||||
// Determine branch name if not specified
|
||||
let branch = args.branch.unwrap_or_else(|| format!("{}{}", args.prefix, args.worktree));
|
||||
let branch = args
|
||||
.branch
|
||||
.unwrap_or_else(|| format!("{}{}", args.prefix, args.worktree));
|
||||
|
||||
// Normalize paths
|
||||
let worktree_path = Path::new(&args.worktree).to_string_lossy();
|
||||
@@ -93,7 +104,10 @@ fn main() -> Result<()> {
|
||||
}
|
||||
|
||||
// Change to worktree directory
|
||||
println!("{}", format!("Moving into worktree: {worktree_path}").dimmed());
|
||||
println!(
|
||||
"{}",
|
||||
format!("Moving into worktree: {worktree_path}").dimmed()
|
||||
);
|
||||
env::set_current_dir(&args.worktree).context("Failed to change directory")?;
|
||||
|
||||
// Update remote
|
||||
|
Reference in New Issue
Block a user