Skip to content

Skills: replace real git in publish tests with CommandStubber #13186

Description

@SamMorrowDrums

Context

Follow-up from #13184 / PR #13185. Review feedback from PR #13171 requested replacing real git usage in publish tests with run.CommandStubber.

This was deferred because it touches 20+ test cases and is better handled as a focused refactor.

Task

Convert all real exec.Command("git", ...) usage in pkg/cmd/skills/publish/publish_test.go to use run.Stub() / run.CommandStubber:

  • Replace initGitRepo helper (creates real git repos with bare remotes) with command stubs for git remote -v, git config --get-regexp, git remote get-url, etc.
  • Replace newTestGitClientWithUpstream helper with stubs for git symbolic-ref, git rev-list, git push
  • Replace runGitInDir helper and all direct exec.Command calls
  • Convert TestEnsurePushed test cases to verify correct git commands are called via stubs
  • Convert inline git init/config/check-ignore calls in test setups

Prior art

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions