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
7 changes: 7 additions & 0 deletions tools/wt-worktree/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@ def test_sync_command_with_rebase(runner, initialized_repo, no_prompt):
assert result.exit_code == 0 or result.exit_code == 3


def test_sync_command_with_rebase_shortcut(runner, initialized_repo, no_prompt):
"""Test wt sync -r command (shortcut for --rebase)."""
# Run sync with -r shortcut - will have no upstream but shouldn't crash
result = runner.invoke(cli, ["sync", "-r"])
assert result.exit_code == 0 or result.exit_code == 3


def test_sync_command_invalid_args(runner, initialized_repo):
"""Test wt sync with invalid argument combinations."""
# Both include and exclude
Expand Down
2 changes: 1 addition & 1 deletion tools/wt-worktree/wt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def config(ctx: Context, key: Optional[str], value: Optional[str],
@click.option("--all", "sync_all", is_flag=True, help="Sync all worktrees")
@click.option("--include", help="Comma-separated list of worktrees to sync")
@click.option("--exclude", help="Comma-separated list of worktrees to skip")
@click.option("--rebase", is_flag=True, help="Rebase onto default base after pull")
@click.option("-r", "--rebase", is_flag=True, help="Rebase onto default base after pull")
@pass_context
def sync(ctx: Context, sync_all: bool, include: Optional[str],
exclude: Optional[str], rebase: bool):
Expand Down
Loading