Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/notify-parent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Notify Parent Repo

on:
push:
branches: [main]

permissions: {}

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Notify parent repo
# PARENT_REPO_PAT requires `repo` scope (or fine-grained `contents:write`)
# on harmony-labs/meta. Configure in Settings → Secrets → Actions.
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4
with:
token: ${{ secrets.PARENT_REPO_PAT }}
repository: harmony-labs/meta
event-type: child-repo-updated
client-payload: >-
{
"repo_name": ${{ toJSON(github.event.repository.name) }},
"sha": ${{ toJSON(github.sha) }},
"actor": ${{ toJSON(github.actor) }}
}
11 changes: 10 additions & 1 deletion src/commands/worktree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub fn execute_worktree_command(
verbose: bool,
json: bool,
strict: bool,
recursive: bool,
) -> CommandResult {
// Extract the subcommand name from the matched command prefix (if present).
// When the plugin registers bare "worktree", the subcommand is in args[0] instead.
Expand All @@ -45,7 +46,7 @@ pub fn execute_worktree_command(
.unwrap_or("");

// Build args for clap
let clap_args: Vec<String> = if subcommand.is_empty() {
let mut clap_args: Vec<String> = if subcommand.is_empty() {
// Bare "worktree" or "git worktree" — args already contains the subcommand (if any)
args.to_vec()
} else {
Expand All @@ -55,6 +56,14 @@ pub fn execute_worktree_command(
.collect()
};

// Inject --recursive if the protocol option was set but the flag wasn't in the
// command args (the host strips global flags like --recursive before forwarding).
// Only inject for `create` — it's the only subcommand that declares this flag.
let is_create = matches!(clap_args.first().map(String::as_str), Some("create"));
if recursive && is_create && !clap_args.iter().any(|a| a == "--recursive" || a == "-r") {
clap_args.push("--recursive".to_string());
}
Comment thread
mateodelnorte marked this conversation as resolved.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

// No subcommand at all — show help
if clap_args.is_empty() {
print_worktree_help();
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub fn execute_command(
options.verbose,
options.json_output,
options.strict,
options.recursive,
);
}

Expand Down