Skip to content

Fix {{ target }} variable in standalone hook execution#106

Merged
max-sixty merged 1 commit intomainfrom
post-merge-sync
Dec 8, 2025
Merged

Fix {{ target }} variable in standalone hook execution#106
max-sixty merged 1 commit intomainfrom
post-merge-sync

Conversation

@max-sixty
Copy link
Owner

Summary

  • Fix wt step pre-merge and wt step post-merge to use current branch as {{ target }} instead of always using default branch
  • Add tests verifying {{ target }} is the current branch when running standalone

Test plan

  • test_step_post_merge_target_is_current_branch - verifies post-merge uses current branch
  • test_step_pre_merge_target_is_current_branch - verifies pre-merge uses current branch
  • All 449 integration tests pass
  • Pre-commit lints pass

🤖 Generated with Claude Code

When running `wt step pre-merge` or `wt step post-merge` standalone,
the {{ target }} template variable was always set to the default branch
(main) instead of the current branch. This caused hooks like:

    if [ "{{ target }}" = "main" ]; then git pull && git push; fi

to always execute, even when running from a feature worktree.

Now {{ target }} reflects the current branch when running standalone,
allowing hooks to behave correctly based on context.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit 0cc6539 into main Dec 8, 2025
15 checks passed
@max-sixty max-sixty deleted the post-merge-sync branch December 8, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant