Skip to content

feat: support git -C directory option#5

Merged
PLNech merged 1 commit intomainfrom
fix/git-global-opts
Mar 18, 2026
Merged

feat: support git -C directory option#5
PLNech merged 1 commit intomainfrom
fix/git-global-opts

Conversation

@PLNech
Copy link
Member

@PLNech PLNech commented Mar 18, 2026

Summary

  • rtk git -C /path/to/repo log --oneline now works (was: unexpected argument '-C')
  • Adds -C flag to the Git command level, threads through to all git invocations via git_cmd() helper
  • Uses thread_local! to avoid threading directory through ~30 internal functions

Test plan

  • 3 new TDD tests: -C parsed, absent = None, passthrough subcommands
  • All 417 tests pass
  • cargo fmt && cargo clippy -- -D warnings clean
  • Manual: rtk git -C /tmp/some-repo status works

@PLNech PLNech merged commit dd16e7c into main Mar 18, 2026
7 checks passed
@PLNech PLNech deleted the fix/git-global-opts branch March 18, 2026 18:09
@PLNech PLNech mentioned this pull request Mar 18, 2026
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.

2 participants