Skip to content

bug: rtk git status outside a repo returns exit 0 instead of git exit code 128 #435

@pavelbe

Description

@pavelbe

Summary

On March 9, 2026, retesting the latest installed local binary /home/pavelbe/bin/rtk (rtk 0.27.2) showed that rtk git status outside a Git repository returns exit 0 instead of matching Git exit code.

This appears to be a separate bug from #163.

Repro 1: current directory outside a repo

cd /tmp

git status; echo $?
# fatal: not a git repository (or any of the parent directories): .git
# 128

rtk git status; echo $?
# Not a git repository
# 0

Repro 2: explicit -C <path> outside a repo

git -C /tmp status; echo $?
# fatal: not a git repository (or any of the parent directories): .git
# 128

rtk git -C /tmp status; echo $?
# Not a git repository
# 0

Expected

rtk git ... status should preserve Git failure semantics for non-repo status:

  • non-zero exit code (128 here),
  • error reported on stderr,
  • no successful-looking exit 0.

Actual

rtk git ... status prints Not a git repository and exits with 0.

Notes

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