INNER CODE UNIT · Rust

handle_commit_push_pr_slash_command

0xKarl-dev/claw-codes · rust/crates/commands/src/lib.rs:810

pub fn handle_commit_push_pr_slash_command(
    request: &CommitPushPrRequest,
    cwd: &Path,
) -> io::Result<String> {
    if !command_exists("gh") {
        return Err(io::Error::other("gh CLI is required for /commit-push-pr"));
    }

    let default_branch = detect_default_branch(cwd)?;
    let mut branch = current_branch(cwd)?;
    let mut created_branch = false;
    if branch == default_branch {
        let hint = if request.branch_name_hint.trim().is_empty() {
            request.pr_title.as_str()
        } else {
            request.branch_name_hint.as_str()
        };
        let next_branch = build_branch_name(hint);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…